Class: Soren::Decoders::Gzip
Instance Method Summary collapse
-
#decode ⇒ Object
: -> String.
-
#initialize(body) ⇒ Gzip
constructor
: (String) -> void.
Constructor Details
#initialize(body) ⇒ Gzip
: (String) -> void
11 12 13 |
# File 'lib/soren/decoders/gzip.rb', line 11 def initialize(body) @body = body #: String end |
Instance Method Details
#decode ⇒ Object
: -> String
16 17 18 19 20 |
# File 'lib/soren/decoders/gzip.rb', line 16 def decode Zlib::GzipReader.new(StringIO.new(@body)).read rescue Zlib::Error raise Soren::Error::ParseError, 'invalid gzip encoded body' end |