class HTTP::Features::AutoDeflate::CompressedBody::GzippedBody

Public Instance Methods

compress(&block) click to toggle source
# File lib/http/features/auto_deflate.rb, line 70
def compress(&block)
  gzip = Zlib::GzipWriter.new(BlockIO.new(block))
  @body.each { |chunk| gzip.write(chunk) }
ensure
  gzip.finish
end