Module: Roo::TableFormatter

Included in:
Base
Defined in:
lib/rggen/core_extensions/roo.rb

Instance Method Summary collapse

Instance Method Details

#to_table(sheet = default_sheet, **options) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/rggen/core_extensions/roo.rb', line 3

def to_table(sheet = default_sheet, **options)
  from_row    = options[:from_row]    || first_row(sheet)
  to_row      = options[:to_row]      || last_row(sheet)
  from_column = options[:from_column] || first_column(sheet)
  to_column   = options[:to_column]   || last_column(sheet)
  from_row.upto(to_row).map do |row|
    from_column.upto(to_column).map { |column| cell(row, column, sheet) }
  end
end