Class: Osheet::WorkbookElement::PartialSet

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

Overview

This ‘WorkbookElement’ class handles all workbook state. It is setup and referenced by the ‘Workbook’ class when it runs builds

Direct Known Subclasses

TemplateSet

Instance Method Summary collapse

Constructor Details

#initializePartialSet

this class is a Hash that behaves kinda like a set. I want to push partials into the set using the ‘<<’ operator, only allow Osheet::Partial objs to be pushed, and then be able to reference a particular partial using its name



69
70
71
# File 'lib/osheet/workbook_element.rb', line 69

def initialize
  super
end

Instance Method Details

#<<(partial) ⇒ Object



73
74
75
76
77
# File 'lib/osheet/workbook_element.rb', line 73

def <<(partial)
  if (key = verify(partial))
    push(key, partial)
  end
end

#get(name) ⇒ Object

return the named partial



80
81
82
# File 'lib/osheet/workbook_element.rb', line 80

def get(name)
  lookup(key(name.to_s))
end