Class: Async::HTTP::Body::Wrapper
Overview
Wrapping body instance. Typically you’d override ‘#read`.
Instance Method Summary
collapse
Methods inherited from Readable
#each, #join
Constructor Details
#initialize(body) ⇒ Wrapper
28
29
30
|
# File 'lib/async/http/body/wrapper.rb', line 28
def initialize(body)
@body = body
end
|
Instance Method Details
#close ⇒ Object
Buffer any remaining body.
41
42
43
44
45
|
# File 'lib/async/http/body/wrapper.rb', line 41
def close
@body = @body.close
return self
end
|
#empty? ⇒ Boolean
32
33
34
|
# File 'lib/async/http/body/wrapper.rb', line 32
def empty?
@body.empty?
end
|
#inspect ⇒ Object
56
57
58
|
# File 'lib/async/http/body/wrapper.rb', line 56
def inspect
return @body.inspect
end
|
#length ⇒ Object
36
37
38
|
# File 'lib/async/http/body/wrapper.rb', line 36
def length
@body.length
end
|
#read ⇒ Object
Read the next available chunk.
48
49
50
|
# File 'lib/async/http/body/wrapper.rb', line 48
def read
@body.read
end
|
#stop(error) ⇒ Object
52
53
54
|
# File 'lib/async/http/body/wrapper.rb', line 52
def stop(error)
@body.stop(error)
end
|