Class: DataTransport::DataStore::CSVFile

Inherits:
File show all
Defined in:
lib/data_transport/data_store/csv_file.rb

Overview

Identical to the File data store, except that it is preconfigured to read and write CSV files.

Instance Attribute Summary

Attributes inherited from File

#mode

Instance Method Summary collapse

Methods inherited from File

#count, #each_record, #write_record

Methods inherited from DataTransport::DataStore

#count, #each_record, #finalize, #reset, #write_record

Constructor Details

#initialize(options = {}) ⇒ CSVFile

Accepts the same options as the File data store, except that the following options have different defaults:

delimiter

“,”

enclosure

“"”

escape

:double

These defaults describe the CSV format.



15
16
17
18
19
20
21
# File 'lib/data_transport/data_store/csv_file.rb', line 15

def initialize(options = {})
  super({
    :delimiter => ",",
    :enclosure => "\"",
    :escape    => :double
  }.merge(options))
end