Ruby
The following section covers the components of Ruby frameworks and their library components that NightVision’s API Discovery capability can detect and use to generate OpenAPI documentation. If a component that you use is not supported, please get in touch with our support team at support@nightvision.net, and we can add this as a new feature.
Ruby on Rails
Section titled “Ruby on Rails”| Library Component | Description |
|---|---|
| ActionController::Base | The base class for all controllers in Rails, providing shared functionality such as rendering and redirects. |
| ActionController::Parameters | Provides a way to handle strong parameters to prevent unwanted attributes from being used in ActiveRecord operations. |
| ActionDispatch::Routing::RouteSet | Manages the routing rules in a Rails application and is responsible for mapping incoming requests to controllers and actions. |
| resources | Defines standard RESTful routes for a collection of resources, including actions like index, create, new, edit, show, update, and destroy. |
| resource | Similar to resources, but used for a singular resource which doesn’t require index or create routes. |
| namespace | Groups controllers under a specific namespace and routes the incoming requests accordingly. |
| member | A routing method that adds more routes to a single resource using standard HTTP verbs which act on a specific member. |
| collection | A routing method that adds additional routes to a collection of resources, not just a single resource. |
| get | Defines a route for a GET request to a specified path mapped to a controller action. |
| post | Defines a route for a POST request to a specified path which typically handles the creation of a resource. |
| put | Defines a route for a PUT request to a specified path which typically handles the updating of a resource. |
| patch | Defines a route for a PATCH request, often used interchangeably with PUT, to update a specific resource. |
| delete | Defines a route for a DELETE request to remove a specific resource. |
| draw | Method used within the routes.rb file to draw routes using a block of routing definitions. |
Library Component
<th> Description </th></tr> <td> Class that provides major part of Grape routing related DSL </td></tr>
<tr> <td> **resource** </td>
<td> Similar to resources, but used for a singular resource which doesn't require index or create routes. </td></tr>
<tr> <td> **namespace** </td>
<td> Groups controllers under a specific namespace and routes the incoming requests accordingly. </td></tr>
<tr> <td> **get** </td>
<td> Defines a route for a GET request to a specified path mapped to a controller action. </td></tr>
<tr> <td> **post** </td>
<td> Defines a route for a POST request to a specified path which typically handles the creation of a resource. </td></tr>
<tr> <td> **put** </td>
<td> Defines a route for a PUT request to a specified path which typically handles the updating of a resource. </td></tr>
<tr> <td> **patch** </td>
<td> Defines a route for a PATCH request, often used interchangeably with PUT, to update a specific resource. </td></tr>
<tr> <td> **delete** </td>
<td> Defines a route for a DELETE request to remove a specific resource. </td></tr>
<tr> <td> **patch** </td>
<td> Defines a route that responds to HTTP `PATCH` requests. </td></tr>
<tr> <td> **mount** </td>
<td> Mounts another Grape API or Rack application\ at a specified path within the current API. </td></tr>
<tr> <td> **version** </td>
<td> Specifies the API version, allowing you to define versioned routes\ and handle different versions of your API endpoints. </td></tr>
<tr> <td> **params** </td>
<td> Defines parameters for the route, specifying expected inputs and validations. </td></tr>
<tr> <td> **prefix** </td>
<td> Sets a prefix for all routes within the API, effectively changing\ the base path for all endpoints. </td></tr>