| Class | Grape::API |
| In: |
lib/grape.rb
lib/grape/validations/validators/coerce.rb lib/grape/api.rb lib/grape/api/helpers.rb lib/grape/api/instance.rb |
| Parent: | Object |
| base_instance | [RW] | |
| instances | [RW] |
This is the interface point between Rack and Grape; it accepts a request from Rack and ultimately returns an array of three values: the status, the headers, and the body. See [the rack specification] (www.rubydoc.info/github/rack/rack/master/file/SPEC) for more. NOTE: This will only be called on an API directly mounted on RACK
Initialize the instance variables on the remountable class, and the base_instance an instance that will be used to create the set up but will not be mounted
The remountable class can have a configuration hash to provide some dynamic class-level variables. For instance, a descripcion could be done using: `desc configuration[:description]` if it may vary depending on where the endpoint is mounted. Use with care, if you find yourself using configuration too much, you may actually want to provide a new API rather than remount it.
Rather than initializing an object of type Grape::API, create an object of type Instance
Replays the set up to produce an API as defined in this class, can be called on classes that inherit from Grape::API