Class: RackMonitor::ProcessUtilization::Body

Inherits:
Object
  • Object
show all
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

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

#closeObject



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