Method: Sequel::Plugins::CsvSerializer::InstanceMethods#from_csv

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

#from_csv(csv, opts = OPTS) ⇒ Object

Update the object using the data provided in the first line in CSV. Options:

:headers

The headers to use for the CSV line. Use nil for a header to specify the column should be ignored.



149
150
151
152
153
# File 'lib/sequel/plugins/csv_serializer.rb', line 149

def from_csv(csv, opts = OPTS)
  row = CsvSerializer.csv_call(:parse_line, csv, model.process_csv_serializer_opts(opts)).to_hash
  row.delete(nil)
  set(row)
end