Class: ActionDispatch::MiddlewareStack::Middleware
- Inherits:
-
Object
- Object
- ActionDispatch::MiddlewareStack::Middleware
show all
- Defined in:
- lib/action_dispatch/middleware/stack.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(klass, args, block) ⇒ Middleware
Returns a new instance of Middleware.
18
19
20
21
22
|
# File 'lib/action_dispatch/middleware/stack.rb', line 18
def initialize(klass, args, block)
@klass = klass
@args = args
@block = block
end
|
Instance Attribute Details
#args ⇒ Object
Returns the value of attribute args.
16
17
18
|
# File 'lib/action_dispatch/middleware/stack.rb', line 16
def args
@args
end
|
#block ⇒ Object
Returns the value of attribute block.
16
17
18
|
# File 'lib/action_dispatch/middleware/stack.rb', line 16
def block
@block
end
|
#klass ⇒ Object
Returns the value of attribute klass.
16
17
18
|
# File 'lib/action_dispatch/middleware/stack.rb', line 16
def klass
@klass
end
|
Instance Method Details
#==(middleware) ⇒ Object
26
27
28
29
30
31
32
33
|
# File 'lib/action_dispatch/middleware/stack.rb', line 26
def ==(middleware)
case middleware
when Middleware
klass == middleware.klass
when Module
klass == middleware
end
end
|
#build(app) ⇒ Object
43
44
45
|
# File 'lib/action_dispatch/middleware/stack.rb', line 43
def build(app)
klass.new(app, *args, &block)
end
|
#build_instrumented(app) ⇒ Object
47
48
49
|
# File 'lib/action_dispatch/middleware/stack.rb', line 47
def build_instrumented(app)
InstrumentationProxy.new(build(app), inspect)
end
|
#inspect ⇒ Object
35
36
37
38
39
40
41
|
# File 'lib/action_dispatch/middleware/stack.rb', line 35
def inspect
if klass.is_a?(Module)
klass.to_s
else
klass.class.to_s
end
end
|
#name ⇒ Object
24
|
# File 'lib/action_dispatch/middleware/stack.rb', line 24
def name; klass.name; end
|