Module: RooModule

Included in:
CsvReader, CsvtReader, CsvxReader, ExcelReader, ExcelxReader, OpenofficeReader
Defined in:
lib/simple_spreadsheet/modules/roo_module.rb

Instance Method Summary collapse

Instance Method Details

#cell(row, col, sheet = nil) ⇒ Object



23
24
25
26
27
28
29
# File 'lib/simple_spreadsheet/modules/roo_module.rb', line 23

def cell(row, col, sheet=nil)
  if sheet.is_a? Integer
    @engine.cell(row, col, @engine.sheets[sheet - 1])
  else
    @engine.cell(row, col, sheet)
  end
end

#celltype(row, col, sheet = nil) ⇒ Object



31
32
33
34
35
36
37
# File 'lib/simple_spreadsheet/modules/roo_module.rb', line 31

def celltype(row, col, sheet=nil)
  if sheet.is_a? Integer
    @engine.celltype(row, col, @engine.sheets[sheet - 1])
  else
    @engine.celltype(row, col, sheet)
  end
end

#default_sheet=(sheet) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/simple_spreadsheet/modules/roo_module.rb', line 7

def default_sheet=(sheet)
  if sheet.is_a? Integer
    @engine.default_sheet = @engine.sheets[sheet - 1]
  else
    @engine.default_sheet = sheet
  end
end

#first_rowObject



15
16
17
# File 'lib/simple_spreadsheet/modules/roo_module.rb', line 15

def first_row
  1
end

#last_rowObject



19
20
21
# File 'lib/simple_spreadsheet/modules/roo_module.rb', line 19

def last_row
  @engine.last_row
end

#sheetsObject



3
4
5
# File 'lib/simple_spreadsheet/modules/roo_module.rb', line 3

def sheets
  @engine.sheets
end