Class: Osheet::WorkbookElement::StyleSet

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

Instance Method Summary collapse

Constructor Details

#initializeStyleSet

this class is an Array with some helper methods. I want to push styles into the set using the ‘<<’ operator, only allow Osheet::Style objs to be pushed, and then be able to reference a particular set of styles using a style class.



171
172
173
# File 'lib/osheet/workbook_element.rb', line 171

def initialize
  super
end

Instance Method Details

#<<(value) ⇒ Object



175
176
177
# File 'lib/osheet/workbook_element.rb', line 175

def <<(value)
  super if verify(value)
end

#for(style_class = nil) ⇒ Object

return the style set for the style class



180
181
182
# File 'lib/osheet/workbook_element.rb', line 180

def for(style_class=nil)
  style_class.nil? ? self : self.select{|s| s.match?(style_class)}
end