Class: ImportEverything::CsvParser

Inherits:
Parser show all
Defined in:
lib/import_everything/parsers/csv_parser.rb

Direct Known Subclasses

TableParser

Instance Method Summary collapse

Instance Method Details

#required_fieldsObject



14
15
16
# File 'lib/import_everything/parsers/csv_parser.rb', line 14

def required_fields
  []
end

#value_hashesObject

Generates the value hashes



6
7
8
9
10
11
12
13
# File 'lib/import_everything/parsers/csv_parser.rb', line 6

def value_hashes
  require 'csv'
  res = []
  CSV.parse(str, :headers => true, :col_sep => delimiter) do |row|
    res << row.to_hash
  end
  res
end