class Rack::Deflater::DeflateStream

Constants

DEFLATE_ARGS

Public Class Methods

new(body) click to toggle source
# File lib/rack/deflater.rb, line 83
def initialize(body)
  @body = body
end

Public Instance Methods

each() { |deflate| ... } click to toggle source
# File lib/rack/deflater.rb, line 87
def each
  deflater = ::Zlib::Deflate.new(*DEFLATE_ARGS)
  @body.each { |part| yield deflater.deflate(part) }
  @body.close if @body.respond_to?(:close)
  yield deflater.finish
  nil
end