Class: Async::HTTP::Body::Remainder
- Defined in:
- lib/async/http/body/fixed.rb
Instance Method Summary collapse
- #empty? ⇒ Boolean
-
#initialize(stream) ⇒ Remainder
constructor
A new instance of Remainder.
- #inspect ⇒ Object
- #join ⇒ Object
- #read ⇒ Object
- #stop(error) ⇒ Object
Methods inherited from Readable
Constructor Details
#initialize(stream) ⇒ Remainder
Returns a new instance of Remainder.
70 71 72 |
# File 'lib/async/http/body/fixed.rb', line 70 def initialize(stream) @stream = stream end |
Instance Method Details
#empty? ⇒ Boolean
74 75 76 |
# File 'lib/async/http/body/fixed.rb', line 74 def empty? @stream.closed? end |
#inspect ⇒ Object
91 92 93 |
# File 'lib/async/http/body/fixed.rb', line 91 def inspect "\#<#{self.class} #{@stream.closed? ? 'closed' : 'open'}>" end |
#join ⇒ Object
87 88 89 |
# File 'lib/async/http/body/fixed.rb', line 87 def join read end |
#read ⇒ Object
83 84 85 |
# File 'lib/async/http/body/fixed.rb', line 83 def read @stream.read_partial end |
#stop(error) ⇒ Object
78 79 80 81 |
# File 'lib/async/http/body/fixed.rb', line 78 def stop(error) # We can't really do anything in this case except close the connection. @stream.close end |