Sha256: 56f38c2d1f363341d91906f47c72958011d0c53271484594fdf5641c452cc916

Contents?: true

Size: 497 Bytes

Versions: 13

Compression:

Stored size: 497 Bytes

Contents

# frozen_string_literal: true

require 'csv'

# Reads in CSV records for traject
module TrajectPlus
  class CsvReader
    # @param input_stream [File]
    # @param settings [Traject::Indexer::Settings]
    def initialize(input_stream, settings)
      @settings = Traject::Indexer::Settings.new settings
      @input_stream = input_stream
      @csv = CSV.parse(input_stream, headers: true)
    end

    def each(*args, &block)
      csv.each(*args, &block)
    end

    attr_reader :csv
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
traject_plus-2.0.1 lib/traject_plus/csv_reader.rb
traject_plus-1.3.0 lib/traject_plus/csv_reader.rb
traject_plus-2.0.0 lib/traject_plus/csv_reader.rb
traject_plus-1.2.2 lib/traject_plus/csv_reader.rb
traject_plus-1.2.1 lib/traject_plus/csv_reader.rb
traject_plus-1.2.0 lib/traject_plus/csv_reader.rb
traject_plus-1.1.1 lib/traject_plus/csv_reader.rb
traject_plus-1.1.0 lib/traject_plus/csv_reader.rb
traject_plus-1.0.0 lib/traject_plus/csv_reader.rb
traject_plus-0.1.0 lib/traject_plus/csv_reader.rb
traject_plus-0.0.3 lib/traject_plus/csv_reader.rb
traject_plus-0.0.2 lib/traject_plus/csv_reader.rb
traject_plus-0.0.1 lib/traject_plus/csv_reader.rb