Class: TrajectPlus::CsvReader
- Inherits:
-
Object
- Object
- TrajectPlus::CsvReader
- Defined in:
- lib/traject_plus/csv_reader.rb
Instance Attribute Summary collapse
-
#csv ⇒ Object
readonly
Returns the value of attribute csv.
Instance Method Summary collapse
- #each(*args, &block) ⇒ Object
-
#initialize(input_stream, settings) ⇒ CsvReader
constructor
A new instance of CsvReader.
Constructor Details
#initialize(input_stream, settings) ⇒ CsvReader
Returns a new instance of CsvReader.
10 11 12 13 14 |
# File 'lib/traject_plus/csv_reader.rb', line 10 def initialize(input_stream, settings) @settings = Traject::Indexer::Settings.new settings @input_stream = input_stream @csv = CSV.parse(input_stream, headers: true) end |
Instance Attribute Details
#csv ⇒ Object (readonly)
Returns the value of attribute csv.
20 21 22 |
# File 'lib/traject_plus/csv_reader.rb', line 20 def csv @csv end |
Instance Method Details
#each(*args, &block) ⇒ Object
16 17 18 |
# File 'lib/traject_plus/csv_reader.rb', line 16 def each(*args, &block) csv.each(*args, &block) end |