Class: HTTP::Features::AutoDeflate::GzippedBody
- Inherits:
-
CompressedBody
- Object
- CompressedBody
- HTTP::Features::AutoDeflate::GzippedBody
- Defined in:
- lib/http/features/auto_deflate.rb
Defined Under Namespace
Classes: BlockIO
Instance Method Summary collapse
Methods inherited from CompressedBody
Constructor Details
This class inherits a constructor from HTTP::Features::AutoDeflate::CompressedBody
Instance Method Details
#compress(&block) ⇒ Object
71 72 73 74 75 76 |
# File 'lib/http/features/auto_deflate.rb', line 71 def compress(&block) gzip = Zlib::GzipWriter.new(BlockIO.new(block)) @body.each { |chunk| gzip.write(chunk) } ensure gzip.finish end |