Class: ActionController::Middleware::ActionMiddleware

Inherits:
Object
  • Object
show all
Defined in:
lib/action_controller/middleware.rb

Instance Method Summary collapse

Constructor Details

#initialize(controller, app) ⇒ ActionMiddleware

Returns a new instance of ActionMiddleware.



4
5
6
# File 'lib/action_controller/middleware.rb', line 4

def initialize(controller, app)
  @controller, @app = controller, app
end

Instance Method Details

#call(env) ⇒ Object



8
9
10
11
# File 'lib/action_controller/middleware.rb', line 8

def call(env)
  request = ActionDispatch::Request.new(env)
  @controller.build(@app).dispatch(:index, request)
end