Class: Rack::Signals::BodyWithCallback

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/contrib/signals.rb

Instance Method Summary collapse

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