Flowdock
method

open_writer

Importance_0
Ruby latest stable (v1_9_3_392) - 0 notes - Class: CSV

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v1_8_7_330) is shown here.

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.