Class: Async::HTTP::Body::Wrapper
- Defined in:
- lib/async/http/body/wrapper.rb
Overview
Wrapping body instance. Typically you’d override ‘#read`.
Direct Known Subclasses
Instance Method Summary collapse
-
#close ⇒ Object
Buffer any remaining body.
- #empty? ⇒ Boolean
-
#initialize(body) ⇒ Wrapper
constructor
A new instance of Wrapper.
- #inspect ⇒ Object
-
#read ⇒ Object
Read the next available chunk.
- #stop(error) ⇒ Object
Methods inherited from Readable
Constructor Details
#initialize(body) ⇒ Wrapper
Returns a new instance of Wrapper.
28 29 30 |
# File 'lib/async/http/body/wrapper.rb', line 28 def initialize(body) @body = body end |
Instance Method Details
#close ⇒ Object
Buffer any remaining body.
37 38 39 40 41 |
# File 'lib/async/http/body/wrapper.rb', line 37 def close @body = @body.close return self end |
#empty? ⇒ Boolean
32 33 34 |
# File 'lib/async/http/body/wrapper.rb', line 32 def empty? @body.empty? end |
#inspect ⇒ Object
52 53 54 |
# File 'lib/async/http/body/wrapper.rb', line 52 def inspect return @body.inspect end |
#read ⇒ Object
Read the next available chunk.
44 45 46 |
# File 'lib/async/http/body/wrapper.rb', line 44 def read @body.read end |
#stop(error) ⇒ Object
48 49 50 |
# File 'lib/async/http/body/wrapper.rb', line 48 def stop(error) @body.stop(error) end |