class Protocol::HTTP::Body::Wrapper
Wrapping body instance. Typically you'd override `#read`.
Attributes
body[R]
The wrapped body.
Public Class Methods
new(body)
click to toggle source
# File lib/protocol/http/body/wrapper.rb, line 36 def initialize(body) @body = body end
wrap(message)
click to toggle source
# File lib/protocol/http/body/wrapper.rb, line 30 def self.wrap(message) if body = message.body message.body = self.new(body) end end
Public Instance Methods
call(stream)
click to toggle source
# File lib/protocol/http/body/wrapper.rb, line 79 def call(stream) @body.call(stream) end
close(error = nil)
click to toggle source
Calls superclass method
Protocol::HTTP::Body::Readable#close
# File lib/protocol/http/body/wrapper.rb, line 48 def close(error = nil) @body.close(error) super end
empty?()
click to toggle source
# File lib/protocol/http/body/wrapper.rb, line 54 def empty? @body.empty? end
finish()
click to toggle source
Buffer any remaining body.
# File lib/protocol/http/body/wrapper.rb, line 44 def finish @body.finish end
inspect()
click to toggle source
# File lib/protocol/http/body/wrapper.rb, line 71 def inspect @body.inspect end
length()
click to toggle source
# File lib/protocol/http/body/wrapper.rb, line 62 def length @body.length end
read()
click to toggle source
Read the next available chunk.
# File lib/protocol/http/body/wrapper.rb, line 67 def read @body.read end
ready?()
click to toggle source
# File lib/protocol/http/body/wrapper.rb, line 58 def ready? @body.ready? end
stream?()
click to toggle source
# File lib/protocol/http/body/wrapper.rb, line 75 def stream? @body.stream? end