class HTTPX::Transcoder::Deflate::Deflater

  1. lib/httpx/transcoder/deflate.rb
Superclass: Deflater

Methods

Public Instance

  1. deflate

Public Instance methods

deflate(chunk)
[show source]
   # File lib/httpx/transcoder/deflate.rb
10 def deflate(chunk)
11   @deflater ||= Zlib::Deflate.new
12 
13   if chunk.nil?
14     unless @deflater.closed?
15       last = @deflater.finish
16       @deflater.close
17       last.empty? ? nil : last
18     end
19   else
20     @deflater.deflate(chunk)
21   end
22 end