class Async::HTTP::BufferedBody
def each(&block)
def each(&block) while @index < @chunks.count yield @chunks[@index] @index += 1 end end
def finished?
def finished? true end
def initialize(body)
def initialize(body) @chunks = [] @index = 0 body.each do |chunk| @chunks << chunk end end
def join
def join buffer = Async::IO::BinaryString.new self.each do |chunk| buffer << chunk end return buffer end
def read
def read if chunk = @chunks[@index] @index += 1 end return chunk end
def rewind
def rewind @index = 0 end