Class: MiniWork

Inherits:
Mustache
  • Object
show all
Defined in:
lib/sawa/MiniWork.rb

Instance Method Summary collapse

Constructor Details

#initialize(file, config) ⇒ MiniWork

Returns a new instance of MiniWork.



7
8
9
10
11
12
13
# File 'lib/sawa/MiniWork.rb', line 7

def initialize(file, config)
  @book = Spreadsheet.open(file, 'r')
  @sheets = Hash.new()
  @book.worksheets.each do |sheet|
    @sheets[sheet.name] = MiniSheet.new(sheet, config)
  end
end

Instance Method Details

#sheet(name) ⇒ Object



27
28
29
# File 'lib/sawa/MiniWork.rb', line 27

def sheet(name)
  @sheets[name]
end

#sheet_arrObject



19
20
21
22
23
24
25
# File 'lib/sawa/MiniWork.rb', line 19

def sheet_arr
  arr = []
  @sheets.each do |name, sheet|
    arr.push(sheet)
  end
  arr
end

#sheetsObject



15
16
17
# File 'lib/sawa/MiniWork.rb', line 15

def sheets
  @sheets
end