Class: RDF::Writer

Inherits:
Object
  • Object
show all
Defined in:
lib/rdf/writer.rb

Class Method Summary collapse

Class Method Details

.gzopen(gzip_filename, options = {}, &block) ⇒ RDF::Writer

Writes output to the given ‘gzip_filename`.

any additional options (see #initialize and Format.for)

Parameters:

  • gzip_filename (String, #to_s)
  • options (Hash{Symbol => Object}) (defaults to: {})

Options Hash (options):

  • :format (Symbol) — default: nil

Returns:



11
12
13
14
15
16
17
# File 'lib/rdf/writer.rb', line 11

def self.gzopen(gzip_filename, options = {}, &block)
  Zlib::GzipWriter.open(gzip_filename) do |file|
    format_options = options.dup
    format_options[:file_name] ||= gzip_filename
    self.for(options[:format] || format_options).new(file, options, &block)
  end
end