Class: Middlestack::Stack::Proxy
- Inherits:
-
Object
- Object
- Middlestack::Stack::Proxy
- Defined in:
- lib/middlestack/stack.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.
6 7 8 |
# File 'lib/middlestack/stack.rb', line 6 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.
4 5 6 |
# File 'lib/middlestack/stack.rb', line 4 def app @app end |
#args ⇒ Object (readonly)
Returns the value of attribute args.
4 5 6 |
# File 'lib/middlestack/stack.rb', line 4 def args @args end |
#block ⇒ Object (readonly)
Returns the value of attribute block.
4 5 6 |
# File 'lib/middlestack/stack.rb', line 4 def block @block end |
#target_class ⇒ Object (readonly)
Returns the value of attribute target_class.
4 5 6 |
# File 'lib/middlestack/stack.rb', line 4 def target_class @target_class end |
Instance Method Details
#call(env) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/middlestack/stack.rb', line 10 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 |