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

Constructor Details

#initialize(stream) ⇒ Remainder

Returns a new instance of Remainder.



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

def initialize(stream)
	@stream = stream
end

Instance Method Details

#empty?Boolean

Returns:

  • (Boolean)


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

def empty?
	@stream.closed?
end

#inspectObject



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

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

#joinObject



84
85
86
# File 'lib/async/http/body/fixed.rb', line 84

def join
	read
end

#readObject



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

def read
	@stream.read_partial
end

#stop(error) ⇒ Object



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

def stop(error)
	@stream.close
end