Class: IOStreams::Gzip::Writer

Inherits:
Writer
  • Object
show all
Defined in:
lib/io_streams/gzip/writer.rb

Instance Attribute Summary

Attributes inherited from Writer

#output_stream

Class Method Summary collapse

Methods inherited from Writer

file, #initialize, open

Constructor Details

This class inherits a constructor from IOStreams::Writer

Class Method Details

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

Write to a stream, compressing with GZip



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

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