Sha256: 09d757d68d0df90e918a78c96fb9e13cbadfdd0e110fdde0e7497b5ead76589a
Contents?: true
Size: 532 Bytes
Versions: 12
Compression:
Stored size: 532 Bytes
Contents
module Aitch class Response class Body def initialize(response) @response = response @body = response.body @encoding = @response["content-encoding"] end def gzip? @encoding == "gzip" end def deflate? @encoding == "deflate" end def to_s if gzip? Zlib::GzipReader.new(StringIO.new(@body)).read elsif deflate? Zlib::Inflate.inflate(@body) else @body end end end end end
Version data entries
12 entries across 12 versions & 1 rubygems