Class: Unteilbar::CsvReader

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

Instance Method Summary collapse

Constructor Details

#initialize(filename) ⇒ CsvReader

Returns a new instance of CsvReader.



5
6
7
8
9
10
# File 'lib/unteilbar/csv_reader.rb', line 5

def initialize(filename)
  @data = []
  CSV.foreach(filename, headers: true) do |row|
    @data << row.to_a
  end
end

Instance Method Details

#dataObject



12
13
14
# File 'lib/unteilbar/csv_reader.rb', line 12

def data
  @data
end

#signerObject

schema from wp-form export



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

def signer
  @data.each_with_object([]) { |item, arr| arr.push(create_signer(item)) }
end