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


31
32
33
34
35
36
37
38
# File 'lib/simple-spreadsheet/modules/roo_module.rb', line 31

def cell(row, col, sheet=nil)
  sheet = @engine.default_sheet if 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


40
41
42
43
44
45
46
# File 'lib/simple-spreadsheet/modules/roo_module.rb', line 40

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

#first_columnObject


23
24
25
# File 'lib/simple-spreadsheet/modules/roo_module.rb', line 23

def first_column
  @engine.first_column
end

#first_rowObject


15
16
17
# File 'lib/simple-spreadsheet/modules/roo_module.rb', line 15

def first_row
  1
end

#last_columnObject


27
28
29
# File 'lib/simple-spreadsheet/modules/roo_module.rb', line 27

def last_column
  @engine.last_column
end

#last_rowObject


19
20
21
# File 'lib/simple-spreadsheet/modules/roo_module.rb', line 19

def last_row
  @engine.last_row
end

#selected_sheet=(sheet) ⇒ Object


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

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

#sheetsObject


3
4
5
# File 'lib/simple-spreadsheet/modules/roo_module.rb', line 3

def sheets
  @engine.sheets
end