Class: Jets::Middleware::Layer
- Inherits:
-
Object
- Object
- Jets::Middleware::Layer
- Defined in:
- lib/jets/middleware/layer.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
-
#initialize(klass, args, block) ⇒ Layer
constructor
A new instance of Layer.
- #inspect ⇒ Object
- #name ⇒ Object
Constructor Details
#initialize(klass, args, block) ⇒ Layer
Returns a new instance of Layer.
5 6 7 8 9 |
# File 'lib/jets/middleware/layer.rb', line 5 def initialize(klass, args, block) @klass = klass @args = args @block = block end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
3 4 5 |
# File 'lib/jets/middleware/layer.rb', line 3 def args @args end |
#block ⇒ Object (readonly)
Returns the value of attribute block.
3 4 5 |
# File 'lib/jets/middleware/layer.rb', line 3 def block @block end |
#klass ⇒ Object (readonly)
Returns the value of attribute klass.
3 4 5 |
# File 'lib/jets/middleware/layer.rb', line 3 def klass @klass end |
Instance Method Details
#==(middleware) ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/jets/middleware/layer.rb', line 13 def ==(middleware) case middleware when Layer klass == middleware.klass when Class klass == middleware end end |
#build(app) ⇒ Object
30 31 32 |
# File 'lib/jets/middleware/layer.rb', line 30 def build(app) klass.new(app, *args, &block) end |
#inspect ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/jets/middleware/layer.rb', line 22 def inspect if klass.is_a?(Class) klass.to_s else klass.class.to_s end end |
#name ⇒ Object
11 |
# File 'lib/jets/middleware/layer.rb', line 11 def name; klass.name; end |