Method: RubyExcel::Sheet#rows

Defined in:
lib/rubyexcel/sheet.rb

#rows(start_row = 1, end_row = data.rows) ⇒ Object Also known as: each

Note:

Iterates to the last Row in the Sheet unless given a second argument.

Yields each Row to the block

Parameters:

  • start_row (Fixnum) (defaults to: 1)

    the Row to start looping from

  • end_row (Fixnum) (defaults to: data.rows)

    the Row to end the loop at



511
512
513
514
# File 'lib/rubyexcel/sheet.rb', line 511

def rows( start_row = 1, end_row = data.rows )
  return to_enum(:rows, start_row, end_row) unless block_given?
  ( start_row..end_row ).each { |idx| yield row( idx ) }; self
end