Methods
C
E
N
W
Class Public methods
new(body, mtime)
# File lib/rack/deflater.rb, line 69
def initialize(body, mtime)
  @body = body
  @mtime = mtime
  @closed = false
end
Instance Public methods
close()
# File lib/rack/deflater.rb, line 92
def close
  return if @closed
  @closed = true
  @body.close if @body.respond_to?(:close)
end
each(&block)
# File lib/rack/deflater.rb, line 75
def each(&block)
  @writer = block
  gzip  =::Zlib::GzipWriter.new(self)
  gzip.mtime = @mtime
  @body.each { |part|
    gzip.write(part)
    gzip.flush
  }
ensure
  gzip.close
  @writer = nil
end
write(data)
# File lib/rack/deflater.rb, line 88
def write(data)
  @writer.call(data)
end