Class: CsvReader

Inherits:
Object
  • Object
show all
Defined in:
lib/csv_reader.rb

Overview

Reads in CSV records for traject

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(input_stream, settings) ⇒ CsvReader

Returns a new instance of CsvReader.

Parameters:

  • input_stream (File)
  • settings (Traject::Indexer::Settings)

10
11
12
13
14
# File 'lib/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

#csvObject (readonly)

Returns the value of attribute csv


18
19
20
# File 'lib/csv_reader.rb', line 18

def csv
  @csv
end