Class Grape::Endpoint
In: lib/grape/endpoint.rb
Parent: Object

An Endpoint is the proxy scope in which all routing blocks are executed. In other words, any methods on the instance level of this class may be called from inside a `get`, `post`, etc.

Methods

Included Modules

Grape::DSL::Settings Grape::DSL::InsideRoute

Attributes

block  [RW] 
env  [R] 
headers  [R] 
options  [RW] 
params  [R] 
request  [R] 
source  [RW] 

Public Class methods

@api private

Create an UnboundMethod that is appropriate for executing an endpoint route.

The unbound method allows explicit calls to return without raising a LocalJumpError. The method will be removed, but a Proc reference to it will be returned. The returned Proc expects a single argument: the instance of Endpoint to bind to the method during the call.

@param [String, Symbol] method_name @return [Proc] @raise [NameError] an instance method with the same name already exists

Create a new endpoint. @param new_settings [InheritableSetting] settings to determine the params,

  validations, and other properties from.

@param options [Hash] attributes of this endpoint @option options path [String or Array] the path to this endpoint, within

  the current scope.

@option options method [String or Array] which HTTP method(s) can be used

  to reach this endpoint.

@option options route_options [Hash] @note This happens at the time of API definition, so in this context the endpoint does not know if it will be mounted under a different endpoint. @yield a block defining what your API should do when this endpoint is hit

Public Instance methods

Return the collection of endpoints within this endpoint. This is the case when an Grape::API mounts another Grape::API.

Update our settings from a given set of stackable parameters. Used when the endpoint‘s API is mounted under another one.

Protected Instance methods

[Validate]