Class: AcceptableApi::Application

Inherits:
Object
  • Object
show all
Defined in:
lib/acceptable_api/application.rb

Instance Method Summary collapse

Constructor Details

#initialize(mappers, routes) ⇒ Application

Returns a new instance of Application.



9
10
11
12
# File 'lib/acceptable_api/application.rb', line 9

def initialize mappers, routes
  self.mappers = mappers
  self.routes = routes
end

Instance Method Details

#call(env) ⇒ Object



14
15
16
17
18
# File 'lib/acceptable_api/application.rb', line 14

def call env
  request = Rack::Request.new env
  action = action_for request
  action.execute
end