Class: HTTP::Features::AutoDeflate::DeflatedBody
- Inherits:
-
CompressedBody
- Object
- Request::Body
- CompressedBody
- HTTP::Features::AutoDeflate::DeflatedBody
- Defined in:
- lib/http/features/auto_deflate.rb
Overview
Deflate-compressed request body wrapper
Instance Attribute Summary
Attributes inherited from Request::Body
Instance Method Summary collapse
-
#compress ⇒ nil
Compresses data using deflate.
Methods inherited from CompressedBody
Methods inherited from Request::Body
#==, #each, #empty?, #initialize, #loggable?, #size
Constructor Details
This class inherits a constructor from HTTP::Features::AutoDeflate::CompressedBody
Instance Method Details
#compress ⇒ nil
Compresses data using deflate
218 219 220 221 222 223 224 225 226 |
# File 'lib/http/features/auto_deflate.rb', line 218 def compress deflater = Zlib::Deflate.new @body.each { |chunk| yield deflater.deflate(chunk) } yield deflater.finish ensure deflater.close end |