Module: SimpleCSV::Extension

Included in:
SimpleCSV, SimpleCSV
Defined in:
lib/simplecsv/extension.rb

Overview

All methods of module SimpleCSV::Extension are extended & included by SimpleCSV. For example, you can use SimpleCSV.parse_file SimpleCSV#parse_file.

Instance Method Summary collapse

Instance Method Details

#parse_file(file_name, options = nil, &block) ⇒ Object

Parse csv file. See SimpleCSV.parse for details.

Parameters

file_name

String : csv file name.

options

Integer : parser options.

row

Array of Strings : parsed data.



13
14
15
16
17
# File 'lib/simplecsv/extension.rb', line 13

def parse_file(file_name, options = nil, &block)
  File.foreach(file_name, options) do |line|
    parse(line, &block)
  end
end