Module: Osheet::Mixin::ClassMethods
- Defined in:
- lib/osheet/mixin.rb
Instance Method Summary collapse
- #partial(name, &block) ⇒ Object
- #partials ⇒ Object
- #style(*selectors, &block) ⇒ Object
- #styles ⇒ Object
- #template(element, name, &block) ⇒ Object
- #templates ⇒ Object
Instance Method Details
#partial(name, &block) ⇒ Object
29 30 31 32 33 |
# File 'lib/osheet/mixin.rb', line 29 def partial(name, &block) instance_variable_set("@p", (instance_variable_get("@p") || []) << ::Osheet::Partial.new(name, &block) ) end |
#partials ⇒ Object
34 35 36 |
# File 'lib/osheet/mixin.rb', line 34 def partials instance_variable_get("@p") || [] end |
#style(*selectors, &block) ⇒ Object
11 12 13 14 15 |
# File 'lib/osheet/mixin.rb', line 11 def style(*selectors, &block) instance_variable_set("@s", (instance_variable_get("@s") || []) << ::Osheet::Style.new(*selectors, &block) ) end |
#styles ⇒ Object
16 17 18 |
# File 'lib/osheet/mixin.rb', line 16 def styles instance_variable_get("@s") || [] end |
#template(element, name, &block) ⇒ Object
20 21 22 23 24 |
# File 'lib/osheet/mixin.rb', line 20 def template(element, name, &block) instance_variable_set("@t", (instance_variable_get("@t") || []) << ::Osheet::Template.new(element, name, &block) ) end |
#templates ⇒ Object
25 26 27 |
# File 'lib/osheet/mixin.rb', line 25 def templates instance_variable_get("@t") || [] end |