Class: Async::HTTP::Body::Remainder
- Defined in:
- lib/async/http/body/fixed.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.
72 73 74 |
# File 'lib/async/http/body/fixed.rb', line 72 def initialize(stream) @stream = stream end |
Instance Method Details
#close(error = nil) ⇒ Object
80 81 82 83 84 85 |
# File 'lib/async/http/body/fixed.rb', line 80 def close(error = nil) # We can't really do anything in this case except close the connection. @stream.close super end |
#empty? ⇒ Boolean
76 77 78 |
# File 'lib/async/http/body/fixed.rb', line 76 def empty? @stream.closed? end |
#inspect ⇒ Object
95 96 97 |
# File 'lib/async/http/body/fixed.rb', line 95 def inspect "\#<#{self.class} #{@stream.closed? ? 'closed' : 'open'}>" end |
#join ⇒ Object
91 92 93 |
# File 'lib/async/http/body/fixed.rb', line 91 def join read end |
#read ⇒ Object
87 88 89 |
# File 'lib/async/http/body/fixed.rb', line 87 def read @stream.read_partial end |