Class: Remi::Encoder::CsvFile
- Inherits:
-
Remi::Encoder
- Object
- Remi::Encoder
- Remi::Encoder::CsvFile
- Includes:
- DataSubject::CsvFile
- Defined in:
- lib/remi/data_subjects/csv_file.rb
Overview
CsvFile Encoder
Instance Attribute Summary collapse
-
#csv_options ⇒ Hash
readonly
Csv options hash.
Attributes inherited from Remi::Encoder
#context, #field_symbolizer, #fields, #logger
Instance Method Summary collapse
-
#encode(dataframe) ⇒ Object
Converts the dataframe to a CSV file stored in the local work directory.
-
#initialize(*args, **kargs, &block) ⇒ CsvFile
constructor
A new instance of CsvFile.
Constructor Details
#initialize(*args, **kargs, &block) ⇒ CsvFile
Returns a new instance of CsvFile.
145 146 147 148 |
# File 'lib/remi/data_subjects/csv_file.rb', line 145 def initialize(*args, **kargs, &block) super init_csv_file_encoder(*args, **kargs, &block) end |
Instance Attribute Details
#csv_options ⇒ Hash (readonly)
Returns Csv options hash.
153 154 155 |
# File 'lib/remi/data_subjects/csv_file.rb', line 153 def @csv_options end |
Instance Method Details
#encode(dataframe) ⇒ Object
Converts the dataframe to a CSV file stored in the local work directory.
159 160 161 162 163 |
# File 'lib/remi/data_subjects/csv_file.rb', line 159 def encode(dataframe) logger.info "Writing CSV file to temporary location #{@working_file}" dataframe.write_csv @working_file, @csv_options @working_file end |