Class: Async::HTTP::Statistics
- Inherits:
-
Object
- Object
- Async::HTTP::Statistics
- Defined in:
- lib/async/http/statistics.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(start_time) ⇒ Statistics
constructor
A new instance of Statistics.
- #wrap(response, &block) ⇒ Object
Constructor Details
#initialize(start_time) ⇒ Statistics
Returns a new instance of Statistics.
17 18 19 |
# File 'lib/async/http/statistics.rb', line 17 def initialize(start_time) @start_time = start_time end |
Class Method Details
.start ⇒ Object
13 14 15 |
# File 'lib/async/http/statistics.rb', line 13 def self.start self.new(Clock.now) end |
Instance Method Details
#wrap(response, &block) ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/async/http/statistics.rb', line 21 def wrap(response, &block) if response and response.body response.body = Body::Statistics.new(@start_time, response.body, block) end return response end |