Class: Rack::Signals::BodyWithCallback
- Inherits:
-
Object
- Object
- Rack::Signals::BodyWithCallback
- Defined in:
- lib/rack/contrib/signals.rb
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#initialize(body, callback) ⇒ BodyWithCallback
constructor
A new instance of BodyWithCallback.
Constructor Details
#initialize(body, callback) ⇒ BodyWithCallback
Returns a new instance of BodyWithCallback.
19 20 21 |
# File 'lib/rack/contrib/signals.rb', line 19 def initialize(body, callback) @body, @callback = body, callback end |
Instance Method Details
#each(&block) ⇒ Object
23 24 25 26 |
# File 'lib/rack/contrib/signals.rb', line 23 def each(&block) @body.each(&block) @callback.call end |