Skip to content

Columns

Leandro Segovia edited this page Feb 23, 2018 · 3 revisions

To map a xls/csv column you need to execute the column method. So, if you have the following definition:

class SuperheroesParser < Parxer::XlsParser
  column(:superhero, name: "Super Hero Name")
end

you will be able to access the "Super Hero Name" for each row like this:

parser = SuperheroesParser.new
result = parser.run("/some_path/superhero.xls"); #=> #<Enumerator: ...>
row = result.next

row.superhero #=> "Wolverine" 

Clone this wiki locally