Module: HTTPX::Transcoder::GZIP

Defined in:
lib/httpx/transcoder/gzip.rb

Defined Under Namespace

Classes: Deflater, Inflater

Class Method Summary collapse

Class Method Details

.decode(response, bytesize: nil) ⇒ Object



65
66
67
68
# File 'lib/httpx/transcoder/gzip.rb', line 65

def decode(response, bytesize: nil)
  bytesize ||= response.headers.key?("content-length") ? response.headers["content-length"].to_i : Float::INFINITY
  Inflater.new(bytesize)
end

.encode(body) ⇒ Object



61
62
63
# File 'lib/httpx/transcoder/gzip.rb', line 61

def encode(body)
  Deflater.new(body)
end