# File lib/rack/deflater.rb, line 54 def initialize(body, mtime) @body = body @mtime = mtime end
# File lib/rack/deflater.rb, line 59 def each(&block) @writer = block gzip =::Zlib::GzipWriter.new(self) gzip.mtime = @mtime @body.each { |part| gzip.write(part) } @body.close if @body.respond_to?(:close) gzip.close @writer = nil end
# File lib/rack/deflater.rb, line 69 def write(data) @writer.call(data) end