Method: CdmMigrator::CsvExportService#write_to_csv

Defined in:
app/services/csv_export_service.rb

#write_to_csv(work_ids, filepath) ⇒ Object

Parameters:

  • - (Array <String>)

    the work ids (for GenericWork or other work type) to export metadata for

  • - (String)

    where to save the csv file to (filepath)



15
16
17
# File 'app/services/csv_export_service.rb', line 15

def write_to_csv(work_ids, filepath)
  File.open(filepath, 'w') { |file| file.write(rows_for(work_ids).map(&:to_csv).join) }
end