Method: Sequel::Plugins::CsvSerializer::ClassMethods#array_from_csv

Defined in:
lib/sequel/plugins/csv_serializer.rb

#array_from_csv(csv, opts = OPTS) ⇒ Object

Attempt to parse an array of instances from the given CSV string



83
84
85
86
87
88
89
# File 'lib/sequel/plugins/csv_serializer.rb', line 83

def array_from_csv(csv, opts = OPTS)
  CSV.parse(csv, process_csv_serializer_opts(opts)).map do |row|
    row = row.to_hash
    row.delete(nil)
    new(row)
  end
end