Class: MiniWork
- Inherits:
-
Mustache
- Object
- Mustache
- MiniWork
- Defined in:
- lib/sawa/MiniWork.rb
Instance Method Summary collapse
-
#initialize(file, config) ⇒ MiniWork
constructor
A new instance of MiniWork.
- #sheet(name) ⇒ Object
- #sheet_arr ⇒ Object
- #sheets ⇒ Object
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_arr ⇒ Object
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 |
#sheets ⇒ Object
15 16 17 |
# File 'lib/sawa/MiniWork.rb', line 15 def sheets @sheets end |