class Rack::Chunked::Body

A body wrapper that emits chunked responses.

def close

Close the response body if the response body supports it.
def close
  @body.close if @body.respond_to?(:close)
end

def each(&block)

the element in chunked encoding.
For each element yielded by the response body, yield
def each(&block)
  term = TERM
  @body.each do |chunk|
    size = chunk.bytesize
    next if size == 0
    yield [size.to_s(16), term, chunk.b, term].join
  end
  yield TAIL
  yield_trailers(&block)
  yield term
end

def initialize(body)

Store the response body to be chunked.
def initialize(body)
  @body = body
end

def yield_trailers

Do nothing as this class does not support trailer headers.
def yield_trailers
end