Class: HTTP::Features::AutoDeflate::DeflatedBody
- Inherits:
-
CompressedBody
- Object
- Request::Body
- CompressedBody
- HTTP::Features::AutoDeflate::DeflatedBody
- Defined in:
- lib/http/features/auto_deflate.rb
Instance Attribute Summary
Attributes inherited from Request::Body
Instance Method Summary collapse
Methods inherited from CompressedBody
Methods inherited from Request::Body
#==, #each, #initialize, #size
Constructor Details
This class inherits a constructor from HTTP::Features::AutoDeflate::CompressedBody
Instance Method Details
#compress ⇒ Object
114 115 116 117 118 119 120 121 122 |
# File 'lib/http/features/auto_deflate.rb', line 114 def compress deflater = Zlib::Deflate.new @body.each { |chunk| yield deflater.deflate(chunk) } yield deflater.finish ensure deflater.close end |