class Inkscape::Merge::DataParser::CSV
CSV
file parser Though Ruby's CSV
would suffice, we explicitly wrap it in an API Other parsers must comply to this API
Public Class Methods
new(data_file, csv_options)
click to toggle source
Read file into memory
# File lib/inkscape_merge/data_parsers.rb, line 32 def initialize(data_file, csv_options) opts = csv_options @data = ::CSV.read data_file, opts end
Public Instance Methods
each(&block)
click to toggle source
Wraps CSV#each
for enumerable support
# File lib/inkscape_merge/data_parsers.rb, line 43 def each(&block) @data.each &block end
headers()
click to toggle source
Return headers as an array
# File lib/inkscape_merge/data_parsers.rb, line 38 def headers @data.headers end