class Rack::Chunked::Body
A body wrapper that emits chunked responses
Constants
- TAIL
- TERM
Public Class Methods
new(body)
click to toggle source
# File lib/rack/chunked.rb, line 17 def initialize(body) @body = body end
Public Instance Methods
close()
click to toggle source
# File lib/rack/chunked.rb, line 33 def close @body.close if @body.respond_to?(:close) end
each() { |[size, term, chunk, term].join| ... }
click to toggle source
# File lib/rack/chunked.rb, line 21 def each term = TERM @body.each do |chunk| size = chunk.bytesize next if size == 0 chunk = chunk.b yield [size.to_s(16), term, chunk, term].join end yield TAIL end