Class: Osheet::WorkbookElement

Inherits:
Object
  • Object
show all
Defined in:
lib/osheet/workbook_element.rb

Defined Under Namespace

Classes: PartialSet, StyleSet, TemplateSet, WorksheetSet

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeWorkbookElement

Returns a new instance of WorkbookElement.



19
20
21
22
23
24
25
26
# File 'lib/osheet/workbook_element.rb', line 19

def initialize
  @title = nil

  @templates  = TemplateSet.new
  @partials   = PartialSet.new
  @styles     = StyleSet.new
  @worksheets = WorksheetSet.new
end

Instance Attribute Details

#partialsObject (readonly)

Returns the value of attribute partials.



17
18
19
# File 'lib/osheet/workbook_element.rb', line 17

def partials
  @partials
end

#styles(*args) ⇒ Object (readonly)

Returns the value of attribute styles.



17
18
19
# File 'lib/osheet/workbook_element.rb', line 17

def styles
  @styles
end

#templatesObject (readonly)

Returns the value of attribute templates.



17
18
19
# File 'lib/osheet/workbook_element.rb', line 17

def templates
  @templates
end

#title(value = nil) ⇒ Object (readonly)

Returns the value of attribute title.



16
17
18
# File 'lib/osheet/workbook_element.rb', line 16

def title
  @title
end

#worksheetsObject (readonly)

Returns the value of attribute worksheets.



17
18
19
# File 'lib/osheet/workbook_element.rb', line 17

def worksheets
  @worksheets
end

Instance Method Details

#==(other) ⇒ Object



52
53
54
55
56
57
58
# File 'lib/osheet/workbook_element.rb', line 52

def ==(other)
  title == other.title &&
  templates == other.templates &&
  partials == other.partials &&
  styles == other.styles &&
  worksheets == other.worksheets
end

#partial(partial) ⇒ Object



36
37
38
# File 'lib/osheet/workbook_element.rb', line 36

def partial(partial)
  @partials << partial
end

#style(style) ⇒ Object



40
41
42
# File 'lib/osheet/workbook_element.rb', line 40

def style(style)
  @styles << style
end

#template(template) ⇒ Object



32
33
34
# File 'lib/osheet/workbook_element.rb', line 32

def template(template)
  @templates << template
end

#worksheet(worksheet) ⇒ Object



44
45
46
# File 'lib/osheet/workbook_element.rb', line 44

def worksheet(worksheet)
  @worksheets << worksheet
end