Class: ExcelAbstraction::WorkBook

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/excel_templating/excel_abstraction/work_book.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file, format: :xls, skip_default_sheet: false) ⇒ WorkBook

Returns a new instance of WorkBook.



5
6
7
8
9
10
11
12
# File 'lib/excel_templating/excel_abstraction/work_book.rb', line 5

def initialize(file, format: :xls, skip_default_sheet: false)
  @format = format
  @file = file
  super(workbook)
  unless skip_default_sheet
    @active_sheet = ExcelAbstraction::Sheet.new(workbook.add_worksheet, workbook)
  end
end

Instance Attribute Details

#active_sheetObject

Returns the value of attribute active_sheet.



3
4
5
# File 'lib/excel_templating/excel_abstraction/work_book.rb', line 3

def active_sheet
  @active_sheet
end

Instance Method Details

#organization(name) ⇒ Object



20
21
22
23
# File 'lib/excel_templating/excel_abstraction/work_book.rb', line 20

def organization(name)
  set_properties(company: name)
  self
end

#title(text) ⇒ Object



15
16
17
18
# File 'lib/excel_templating/excel_abstraction/work_book.rb', line 15

def title(text)
  set_properties(title: text)
  self
end