class SpreadsheetRoo
include #Contracts ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Attributes
filepath[R]
Public Class Methods
new(filepath)
click to toggle source
Contract String => Any
# File lib/tmis/engine/import/spreadsheet_roo.rb, line 16 def initialize(filepath) @filepath = filepath.force_encoding("UTF-8") @sheet = Roo::Spreadsheet.open(@filepath) @sheet.default_sheet = 0 end
Public Instance Methods
[](r, c)
click to toggle source
Contract Pos, Pos => Any
# File lib/tmis/engine/import/spreadsheet_roo.rb, line 48 def [](r, c) @sheet.cell(r, c) end
column(n)
click to toggle source
Contract Pos => Any
# File lib/tmis/engine/import/spreadsheet_roo.rb, line 43 def column(n) @sheet.column(n) end
last_column()
click to toggle source
Contract None => Pos
# File lib/tmis/engine/import/spreadsheet_roo.rb, line 28 def last_column @sheet.last_column end
last_row()
click to toggle source
Contract None => Pos
# File lib/tmis/engine/import/spreadsheet_roo.rb, line 23 def last_row @sheet.last_row end
row(n)
click to toggle source
Contract Pos => Any
# File lib/tmis/engine/import/spreadsheet_roo.rb, line 38 def row(n) @sheet.row(n) end
sheet(number)
click to toggle source
Contract Not => Any
# File lib/tmis/engine/import/spreadsheet_roo.rb, line 33 def sheet(number) @sheet.default_sheet = @sheet.sheets[number-1] end