lib/simple-spreadsheet/classes/csvt_extended.rb in simple-spreadsheet-0.1.1 vs lib/simple-spreadsheet/classes/csvt_extended.rb in simple-spreadsheet-0.2.0

- old
+ new

@@ -1,8 +1,14 @@ -require 'roo/generic_spreadsheet' -require 'roo/csv' +class CsvtExtended < Roo::Csv -class CsvtExtended < Csv + def foreach(sheet = nil, &block) + index = 1 + CSV.foreach(@filename, col_sep: "\t") do |row| + yield(row, index) + index += 1 + end + end + def read_cells(sheet=nil) sheet = @default_sheet unless sheet @cell_type = {} unless @cell_type @cell = {} unless @cell @first_row[sheet] = 1 \ No newline at end of file