Class: HTTPX::Plugins::Brotli::Deflater
- Inherits:
-
Transcoder::Deflater
- Object
- Transcoder::Deflater
- HTTPX::Plugins::Brotli::Deflater
- Defined in:
- lib/httpx/plugins/brotli.rb
Instance Attribute Summary
Attributes inherited from Transcoder::Deflater
Instance Method Summary collapse
- #deflate(chunk) ⇒ Object
-
#initialize(body) ⇒ Deflater
constructor
A new instance of Deflater.
Methods inherited from Transcoder::Deflater
#bytesize, #close, #read, #rewind
Constructor Details
#initialize(body) ⇒ Deflater
Returns a new instance of Deflater.
9 10 11 12 |
# File 'lib/httpx/plugins/brotli.rb', line 9 def initialize(body) @compressor = ::Brotli::Compressor.new super end |
Instance Method Details
#deflate(chunk) ⇒ Object
14 15 16 17 18 |
# File 'lib/httpx/plugins/brotli.rb', line 14 def deflate(chunk) return @compressor.process(chunk) << @compressor.flush if chunk @compressor.finish end |