Skip to content

Commit

Permalink
Fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnyshields committed May 26, 2021
1 parent 76295fd commit d02ebb9
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions lib/httparty/decompressor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ module HTTParty
class Decompressor
UncompressedEncodings = [nil, 'none', 'identity'].freeze

# gzip and default are handled by Net::HTTP
# gzip and deflate are handled by Net::HTTP
# hence they do not need to be handled by HTTParty
SupportedEncodings = {
'br' => :brotli,
'compress' => :lzw
Expand All @@ -24,22 +25,18 @@ class Decompressor
# @return [String]
attr_reader :body

# The Content-Encoding compression algorithm used to encode the body
# The Content-Encoding algorithm used to encode the body
# @return [Symbol] e.g. :gzip
attr_reader :encoding

# @param [String] body - the response body of the request
# @param [Symbol] encoding - the Content-Encoding algorithm used to encode the body
def initialize(body, encoding)
@body = body
@encoding = encoding
end



# Instantiate the parser and call {#decompressed}.
# @param [String] body the response body
# @param [Symbol] encoding the response Content-Encoding value
# @return decompressed response

# Perform decompression on the response body
# @return [String] the decompressed body
# @return [nil] when the response body is nil or cannot decompressed
def decompress
Expand Down

0 comments on commit d02ebb9

Please sign in to comment.