Class: Osheet::StyleSet
- Inherits:
-
Array
- Object
- Array
- Osheet::StyleSet
- Defined in:
- lib/osheet/style_set.rb
Instance Method Summary collapse
- #<<(value) ⇒ Object
-
#for(style_class) ⇒ Object
return the style set for the style class.
-
#initialize ⇒ StyleSet
constructor
this class is an Array has some helper methods.
Constructor Details
#initialize ⇒ StyleSet
this class is an Array has 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.
11 12 13 |
# File 'lib/osheet/style_set.rb', line 11 def initialize super end |
Instance Method Details
#<<(value) ⇒ Object
15 16 17 |
# File 'lib/osheet/style_set.rb', line 15 def <<(value) super if verify(value) end |
#for(style_class) ⇒ Object
return the style set for the style class
20 21 22 |
# File 'lib/osheet/style_set.rb', line 20 def for(style_class) self.select{|s| s.match?(style_class)} end |