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

#each, #finish, #length

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

Returns:

  • (Boolean)


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

def empty?
	@stream.closed?
end

#inspectObject



95
96
97
# File 'lib/async/http/body/fixed.rb', line 95

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

#joinObject



91
92
93
# File 'lib/async/http/body/fixed.rb', line 91

def join
	read
end

#readObject



87
88
89
# File 'lib/async/http/body/fixed.rb', line 87

def read
	@stream.read_partial
end