Method: Grape::API::Instance#initialize
- Defined in:
- lib/grape/api/instance.rb
#initialize ⇒ Instance
Builds the routes from the defined endpoints, effectively compiling this API into a usable form.
131 132 133 134 135 136 137 138 139 140 |
# File 'lib/grape/api/instance.rb', line 131 def initialize @router = Router.new self.class.endpoints.each do |endpoint| endpoint.mount_in(@router) end @router.compile! @router.freeze end |