Class: ArcFurnace::MultiCSVSource
- Includes:
- CSVToHashWithDuplicateHeaders
- Defined in:
- lib/arc-furnace/multi_csv_source.rb
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Attributes inherited from Node
#error_handler, #node_id, #params
Instance Method Summary collapse
- #advance ⇒ Object
-
#empty? ⇒ Boolean
Is this source empty?.
-
#initialize(filenames:, encoding: 'UTF-8') ⇒ MultiCSVSource
constructor
A new instance of MultiCSVSource.
Methods included from CSVToHashWithDuplicateHeaders
Methods inherited from Source
#close, #finalize, #prepare, #row
Constructor Details
#initialize(filenames:, encoding: 'UTF-8') ⇒ MultiCSVSource
Returns a new instance of MultiCSVSource.
11 12 13 14 15 |
# File 'lib/arc-furnace/multi_csv_source.rb', line 11 def initialize(filenames: , encoding: 'UTF-8') @encoding = encoding @filenames = filenames.reverse open_next_file end |
Instance Attribute Details
#file ⇒ Object (readonly)
Returns the value of attribute file.
9 10 11 |
# File 'lib/arc-furnace/multi_csv_source.rb', line 9 def file @file end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
9 10 11 |
# File 'lib/arc-furnace/multi_csv_source.rb', line 9 def value @value end |
Instance Method Details
#advance ⇒ Object
22 23 24 |
# File 'lib/arc-furnace/multi_csv_source.rb', line 22 def advance advance_in_current_file || open_next_file end |
#empty? ⇒ Boolean
Is this source empty?
18 19 20 |
# File 'lib/arc-furnace/multi_csv_source.rb', line 18 def empty? !value end |