Parent

Methods

Rack::Deflater::GzipStream

Public Class Methods

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

Public Instance Methods

each(&block) click to toggle source
# File lib/rack/deflater.rb, line 61
def each(&block)
  @writer = block
  gzip  =::Zlib::GzipWriter.new(self)
  gzip.mtime = @mtime
  @body.each { |part|
    gzip.write(part)
    gzip.flush
  }
ensure
  @body.close if @body.respond_to?(:close)
  gzip.close
  @writer = nil
end
write(data) click to toggle source
# File lib/rack/deflater.rb, line 75
def write(data)
  @writer.call(data)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.