Class: CsvtExtended

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

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ CsvtExtended


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

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

Instance Method Details

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


6
7
8
9
10
11
12
# File 'lib/simple-spreadsheet/classes/csvt_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