Sha256: f7d8a1436e71fae7fac85c3fb6c93420d5065837dffcee58b4181d9c38181f2e

Contents?: true

Size: 351 Bytes

Versions: 4

Compression:

Stored size: 351 Bytes

Contents

module ImportEverything
  class CsvParser < Parser
    fattr(:delimiter) { "," }
    
    # Generates the value hashes
    def value_hashes
      require 'csv'
      res = []
      CSV.parse(str, :headers => true, :col_sep => delimiter) do |row|
        res << row.to_hash
      end
      res
    end
    def required_fields
      []
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
import_everything-0.1.6 lib/import_everything/parsers/csv_parser.rb
import_everything-0.1.5 lib/import_everything/parsers/csv_parser.rb
import_everything-0.1.3 lib/import_everything/parsers/csv_parser.rb
import_everything-0.1.2 lib/import_everything/parsers/csv_parser.rb