Class: ActionDispatch::MiddlewareStack::Middleware
- Defined in:
- actionpack/lib/action_dispatch/middleware/stack.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#klass ⇒ Object
readonly
Returns the value of attribute klass.
Instance Method Summary collapse
- #==(middleware) ⇒ Object
- #build(app) ⇒ Object
- #build_instrumented(app) ⇒ Object
-
#initialize(klass, args, block) ⇒ Middleware
constructor
A new instance of Middleware.
- #inspect ⇒ Object
- #name ⇒ Object
Constructor Details
#initialize(klass, args, block) ⇒ Middleware
Returns a new instance of Middleware.
11 12 13 14 15 |
# File 'actionpack/lib/action_dispatch/middleware/stack.rb', line 11 def initialize(klass, args, block) @klass = klass @args = args @block = block end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args
9 10 11 |
# File 'actionpack/lib/action_dispatch/middleware/stack.rb', line 9 def args @args end |
#block ⇒ Object (readonly)
Returns the value of attribute block
9 10 11 |
# File 'actionpack/lib/action_dispatch/middleware/stack.rb', line 9 def block @block end |
#klass ⇒ Object (readonly)
Returns the value of attribute klass
9 10 11 |
# File 'actionpack/lib/action_dispatch/middleware/stack.rb', line 9 def klass @klass end |
Instance Method Details
#==(middleware) ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'actionpack/lib/action_dispatch/middleware/stack.rb', line 19 def ==(middleware) case middleware when Middleware klass == middleware.klass when Module klass == middleware end end |
#build(app) ⇒ Object
36 37 38 |
# File 'actionpack/lib/action_dispatch/middleware/stack.rb', line 36 def build(app) klass.new(app, *args, &block) end |
#build_instrumented(app) ⇒ Object
40 41 42 |
# File 'actionpack/lib/action_dispatch/middleware/stack.rb', line 40 def build_instrumented(app) InstrumentationProxy.new(build(app), inspect) end |
#inspect ⇒ Object
28 29 30 31 32 33 34 |
# File 'actionpack/lib/action_dispatch/middleware/stack.rb', line 28 def inspect if klass.is_a?(Module) klass.to_s else klass.class.to_s end end |
#name ⇒ Object
17 |
# File 'actionpack/lib/action_dispatch/middleware/stack.rb', line 17 def name; klass.name; end |