Class: Zinzout::ZoutFile

Inherits:
ZinFile show all
Defined in:
lib/zinzout.rb

Instance Attribute Summary

Attributes inherited from ZinFile

#io

Instance Method Summary collapse

Methods inherited from ZinFile

#close, #initialize

Constructor Details

This class inherits a constructor from Zinzout::ZinFile

Instance Method Details

#io_from_file(filename, encoding) ⇒ Object



69
70
71
72
73
74
75
# File 'lib/zinzout.rb', line 69

def io_from_file(filename, encoding)
  if /\.gz\Z/.match(filename)
    Zlib::GzipWriter.open(filename, nil, nil, encoding: encoding)
  else
    File.open(filename, 'w', encoding: encoding)
  end
end