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
- #length ⇒ 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.
41 42 43 44 45 |
# File 'lib/async/http/body/wrapper.rb', line 41 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
56 57 58 |
# File 'lib/async/http/body/wrapper.rb', line 56 def inspect return @body.inspect end |
#length ⇒ Object
36 37 38 |
# File 'lib/async/http/body/wrapper.rb', line 36 def length @body.length end |
#read ⇒ Object
Read the next available chunk.
48 49 50 |
# File 'lib/async/http/body/wrapper.rb', line 48 def read @body.read end |
#stop(error) ⇒ Object
52 53 54 |
# File 'lib/async/http/body/wrapper.rb', line 52 def stop(error) @body.stop(error) end |