Class: Async::HTTP::Body::Remainder

Inherits:
Readable
  • Object
show all
Defined in:
lib/async/http/body/fixed.rb

Instance Method Summary collapse

Methods inherited from Readable

#close, #each, #length, #stop

Constructor Details

#initialize(stream) ⇒ Remainder

Returns a new instance of Remainder.



64
65
66
# File 'lib/async/http/body/fixed.rb', line 64

def initialize(stream)
	@stream = stream
end

Instance Method Details

#empty?Boolean

Returns:

  • (Boolean)


68
69
70
# File 'lib/async/http/body/fixed.rb', line 68

def empty?
	@stream.closed?
end

#inspectObject



80
81
82
# File 'lib/async/http/body/fixed.rb', line 80

def inspect
	"\#<#{self.class} #{@stream.closed? ? 'closed' : 'open'}>"
end

#joinObject



76
77
78
# File 'lib/async/http/body/fixed.rb', line 76

def join
	read
end

#readObject



72
73
74
# File 'lib/async/http/body/fixed.rb', line 72

def read
	@stream.read unless @stream.closed?
end