mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Add docs for ActionController::Metal class methods
This commit is contained in:
parent
837f0ab5c8
commit
cc446d6c9f
1 changed files with 5 additions and 1 deletions
|
@ -201,19 +201,23 @@ module ActionController
|
|||
class_attribute :middleware_stack
|
||||
self.middleware_stack = ActionController::MiddlewareStack.new
|
||||
|
||||
def self.inherited(base)
|
||||
def self.inherited(base) #nodoc:
|
||||
base.middleware_stack = self.middleware_stack.dup
|
||||
super
|
||||
end
|
||||
|
||||
# Adds given middleware class and its args to bottom of middleware_stack
|
||||
def self.use(*args, &block)
|
||||
middleware_stack.use(*args, &block)
|
||||
end
|
||||
|
||||
# Alias for middleware_stack
|
||||
def self.middleware
|
||||
middleware_stack
|
||||
end
|
||||
|
||||
# Makes the controller a rack endpoint that points to the action in
|
||||
# the given env's action_dispatch.request.path_parameters key.
|
||||
def self.call(env)
|
||||
action(env['action_dispatch.request.path_parameters'][:action]).call(env)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue