method

open_reader

Importance_0
v1_8_6_287 - Show latest stable - 0 notes - Class: CSV
open_reader(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 307
    def open_reader(path, mode, fs, rs, &block)
      file = File.open(path, mode)
      if block
        begin
          CSV::Reader.parse(file, fs, rs) do |row|
            yield(row)
          end
        ensure
          file.close
        end
        nil
      else
        reader = CSV::Reader.create(file, fs, rs)
        reader.close_on_terminate
        reader
      end
    end
Register or log in to add new notes.