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, #stop

Constructor Details

#initialize(stream) ⇒ Remainder

Returns a new instance of Remainder.



61
62
63
# File 'lib/async/http/body/fixed.rb', line 61

def initialize(stream)
	@stream = stream
end

Instance Method Details

#empty?Boolean

Returns:

  • (Boolean)


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

def empty?
	@stream.closed?
end

#inspectObject



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

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

#joinObject



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

def join
	read
end

#readObject



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

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