Class: Spreadsheet::Worksheet

Inherits:
Object
  • Object
show all
Defined in:
lib/roo/worksheet.rb

Overview

patch for skipping blank rows in the case of having a spreadsheet with 30,000 nil rows appended to the actual data. (it happens and your RAM will love me)

Instance Method Summary collapse

Instance Method Details

#each(skip = dimensions[0]) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
# File 'lib/roo/worksheet.rb', line 6

def each skip=dimensions[0]
  blanks = 0
  skip.upto(dimensions[1] - 1) do |i|
    if row(i).any?
      Proc.new.call(row(i))
    else
      blanks += 1
      blanks < 20 ? next : return
    end
  end
end