Class: IOStreams::Gzip::Reader

Inherits:
Reader
  • Object
show all
Defined in:
lib/io_streams/gzip/reader.rb

Instance Attribute Summary

Attributes inherited from Reader

#input_stream

Class Method Summary collapse

Methods inherited from Reader

file, #initialize, open

Constructor Details

This class inherits a constructor from IOStreams::Reader

Class Method Details

.stream(input_stream, original_file_name: nil, &block) ⇒ Object

Read from a gzip stream, decompressing the contents as it is read



5
6
7
8
9
10
# File 'lib/io_streams/gzip/reader.rb', line 5

def self.stream(input_stream, original_file_name: nil, &block)
  io = ::Zlib::GzipReader.new(input_stream)
  block.call(io)
ensure
  io&.close
end