Class: Async::HTTP::Body::Remainder
- Defined in:
- lib/async/http/body/remainder.rb
Instance Method Summary collapse
- #close(error = nil) ⇒ Object
- #empty? ⇒ Boolean
-
#initialize(stream) ⇒ Remainder
constructor
A new instance of Remainder.
- #inspect ⇒ Object
- #join ⇒ Object
- #read ⇒ Object
Methods inherited from Readable
Constructor Details
#initialize(stream) ⇒ Remainder
Returns a new instance of Remainder.
27 28 29 |
# File 'lib/async/http/body/remainder.rb', line 27 def initialize(stream) @stream = stream end |
Instance Method Details
#close(error = nil) ⇒ Object
35 36 37 38 39 40 |
# File 'lib/async/http/body/remainder.rb', line 35 def close(error = nil) # We can't really do anything in this case except close the connection. @stream.close super end |
#empty? ⇒ Boolean
31 32 33 |
# File 'lib/async/http/body/remainder.rb', line 31 def empty? @stream.closed? end |
#inspect ⇒ Object
50 51 52 |
# File 'lib/async/http/body/remainder.rb', line 50 def inspect "\#<#{self.class} #{@stream.closed? ? 'closed' : 'open'}>" end |
#join ⇒ Object
46 47 48 |
# File 'lib/async/http/body/remainder.rb', line 46 def join read end |
#read ⇒ Object
42 43 44 |
# File 'lib/async/http/body/remainder.rb', line 42 def read @stream.read_partial end |