Class: RackMonitor::ProcessUtilization::Body
- Inherits:
-
Object
- Object
- RackMonitor::ProcessUtilization::Body
- Defined in:
- lib/rack_monitor.rb
Overview
Body wrapper. Yields to the block when body is closed. This is used to signal when a response is fully finished processing.
Instance Method Summary collapse
- #close ⇒ Object
- #each(&block) ⇒ Object
-
#initialize(body, &block) ⇒ Body
constructor
A new instance of Body.
Constructor Details
#initialize(body, &block) ⇒ Body
Returns a new instance of Body.
243 244 245 246 |
# File 'lib/rack_monitor.rb', line 243 def initialize(body, &block) @body = body @block = block end |
Instance Method Details
#close ⇒ Object
252 253 254 255 256 |
# File 'lib/rack_monitor.rb', line 252 def close @body.close if @body.respond_to?(:close) @block.call nil end |
#each(&block) ⇒ Object
248 249 250 |
# File 'lib/rack_monitor.rb', line 248 def each(&block) @body.each(&block) end |