Class: Walle::Middlewares::Builder::Proxy
- Inherits:
-
Object
- Object
- Walle::Middlewares::Builder::Proxy
- Defined in:
- lib/walle/middlewares/builder.rb
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#target_class ⇒ Object
readonly
Returns the value of attribute target_class.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(target_class, app, *args, &block) ⇒ Proxy
constructor
A new instance of Proxy.
Constructor Details
#initialize(target_class, app, *args, &block) ⇒ Proxy
Returns a new instance of Proxy.
7 8 9 |
# File 'lib/walle/middlewares/builder.rb', line 7 def initialize(target_class, app, *args, &block) @target_class, @app, @args, @block = target_class, app, args, block end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
5 6 7 |
# File 'lib/walle/middlewares/builder.rb', line 5 def app @app end |
#args ⇒ Object (readonly)
Returns the value of attribute args.
5 6 7 |
# File 'lib/walle/middlewares/builder.rb', line 5 def args @args end |
#block ⇒ Object (readonly)
Returns the value of attribute block.
5 6 7 |
# File 'lib/walle/middlewares/builder.rb', line 5 def block @block end |
#target_class ⇒ Object (readonly)
Returns the value of attribute target_class.
5 6 7 |
# File 'lib/walle/middlewares/builder.rb', line 5 def target_class @target_class end |
Instance Method Details
#call(env) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/walle/middlewares/builder.rb', line 11 def call(env) with_env(env) do |target| target.before if target.respond_to?(:before) app.call(env) target.after if target.respond_to?(:after) end end |