method

open_writer

Importance_0
v1_8_7_330 - Show latest stable - 0 notes - Class: CSV
open_writer(path, mode, fs, rs, &block) private

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/csv.rb, line 325
    def open_writer(path, mode, fs, rs, &block)
      file = File.open(path, mode)
      if block
        begin
          CSV::Writer.generate(file, fs, rs) do |writer|
            yield(writer)
          end
        ensure
          file.close
        end
        nil
      else
        writer = CSV::Writer.create(file, fs, rs) 
        writer.close_on_terminate
        writer
      end
    end
Register or log in to add new notes.