Method: Rack::Deflater::GzipStream#each

Defined in:
lib/rack/deflater.rb

#each(&block) ⇒ Object



59
60
61
62
63
64
65
66
67
# 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