Class: Sp2db::Spreadsheet

Inherits:
Object
  • Object
show all
Defined in:
lib/sp2db/spreadsheet.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(sheet) ⇒ Spreadsheet

Returns a new instance of Spreadsheet.



6
7
8
# File 'lib/sp2db/spreadsheet.rb', line 6

def initialize sheet
  self.sheet = sheet
end

Instance Attribute Details

#sheetObject

Returns the value of attribute sheet.



4
5
6
# File 'lib/sp2db/spreadsheet.rb', line 4

def sheet
  @sheet
end

Instance Method Details

#worksheet_by_name(ws_name) ⇒ Object



14
15
16
# File 'lib/sp2db/spreadsheet.rb', line 14

def worksheet_by_name ws_name
  sheet.worksheet_by_title ws_name
end

#worksheetsObject



10
11
12
# File 'lib/sp2db/spreadsheet.rb', line 10

def worksheets
  sheet.worksheets.index_by(&:title).with_indifferent_access
end