class Unteilbar::CsvReader

Public Class Methods

new(filename) click to toggle source
# 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

Public Instance Methods

data() click to toggle source
# File lib/unteilbar/csv_reader.rb, line 12
def data
  @data
end
signer() click to toggle source

schema from wp-form export

# File lib/unteilbar/csv_reader.rb, line 19
def signer
  @data.each_with_object([]) { |item, arr| arr.push(create_signer(item)) }
end

Private Instance Methods

create_signer(arr) click to toggle source
# File lib/unteilbar/csv_reader.rb, line 25
def create_signer(arr)
  Signer.new(arr[0][1], arr[1][1], arr[2][1], arr[3][1])
end