Class: Remi::DataTarget::CsvFile

Inherits:
Remi::DataTarget show all
Includes:
Remi::DataSubject::CsvFile
Defined in:
lib/remi/data_subject/csv_file.rb

Instance Attribute Summary collapse

Attributes inherited from Remi::DataSubject

#fields

Instance Method Summary collapse

Methods included from Remi::DataSubject::CsvFile

#field_symbolizer, included

Methods inherited from Remi::DataTarget

#load

Methods inherited from Remi::DataSubject

#df, #df=, #enforce_types, #field_symbolizer

Constructor Details

#initialize(*args, **kargs, &block) ⇒ CsvFile

Returns a new instance of CsvFile.



137
138
139
140
# File 'lib/remi/data_subject/csv_file.rb', line 137

def initialize(*args, **kargs, &block)
  super
  init_csv_file(*args, **kargs, &block)
end

Instance Attribute Details

#csv_optionsObject (readonly)

Returns the value of attribute csv_options.



142
143
144
# File 'lib/remi/data_subject/csv_file.rb', line 142

def csv_options
  @csv_options
end

Instance Method Details

#load!Object

Public: Performs the load operation, regardless of whether it has already executed.

Returns true if the load operation was successful



148
149
150
151
152
# File 'lib/remi/data_subject/csv_file.rb', line 148

def load!
  @logger.info "Writing CSV file #{@path}"
  df.write_csv @path, @csv_options
  true
end