Class: ActionController::Middleware

Inherits:
Metal show all
Defined in:
actionpack/lib/action_controller/middleware.rb

Defined Under Namespace

Classes: ActionMiddleware

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Metal

action, call, #content_type, #content_type=, controller_name, #controller_name, #dispatch, #env, inherited, #location, #location=, middleware, #params, #params=, #performed?, #response_body=, #status, #status=, #to_a, #url_for, use

Methods inherited from AbstractController::Base

abstract!, action_methods, #action_methods, #available_action?, clear_action_methods!, #controller_path, controller_path, hidden_actions, inherited, internal_methods, method_added

Methods included from ActiveSupport::DescendantsTracker

clear, descendants, #descendants, #direct_descendants, direct_descendants, #inherited, store_inherited

Methods included from ActiveSupport::Configurable

#config

Methods included from ActiveSupport::Concern

#append_features, extended, #included

Constructor Details

#initialize(app) ⇒ Middleware

Returns a new instance of Middleware.



30
31
32
33
# File 'actionpack/lib/action_controller/middleware.rb', line 30

def initialize(app)
  super()
  @_app = app
end

Class Method Details

.buildObject



15
# File 'actionpack/lib/action_controller/middleware.rb', line 15

alias build new

.new(app) ⇒ Object



17
18
19
# File 'actionpack/lib/action_controller/middleware.rb', line 17

def new(app)
  ActionMiddleware.new(self, app)
end

Instance Method Details

#indexObject



35
36
37
# File 'actionpack/lib/action_controller/middleware.rb', line 35

def index
  call(env)
end

#process(action) ⇒ Object



24
25
26
27
28
# File 'actionpack/lib/action_controller/middleware.rb', line 24

def process(action)
  response = super
  self.status, self.headers, self.response_body = response if response.is_a?(Array)
  response
end