Class: CsvxExtended

Inherits:
Roo::CSV
  • Object
show all
Defined in:
lib/simple-spreadsheet/classes/csvx_extended.rb

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ CsvxExtended

Returns a new instance of CsvxExtended.


2
3
4
# File 'lib/simple-spreadsheet/classes/csvx_extended.rb', line 2

def initialize(path)
  super(path, csv_options: { col_sep: ";" })
end

Instance Method Details

#foreach(sheet = nil, &block) ⇒ Object


6
7
8
9
10
11
12
# File 'lib/simple-spreadsheet/classes/csvx_extended.rb', line 6

def foreach(sheet = nil, &block)
  index = 1
  CSV.foreach(@filename, csv_options) do |row|
    yield(row, index)
    index += 1
  end
end