Class: Habaki::StyleRule
Overview
CSS style rule selectors + declarations
Instance Attribute Summary collapse
Attributes inherited from Rule
Instance Method Summary collapse
-
#element_match?(element) ⇒ Boolean
does rule match Visitor::Element ?.
-
#initialize ⇒ StyleRule
constructor
A new instance of StyleRule.
- #read_from_katana(rule) ⇒ void private
- #string(format = Formatter::Base.new) ⇒ String
Methods inherited from Rule
#each_declaration, #each_selector, #rules
Methods inherited from Node
Constructor Details
#initialize ⇒ StyleRule
Returns a new instance of StyleRule.
9 10 11 12 |
# File 'lib/habaki/style_rule.rb', line 9 def initialize @selectors = Selectors.new @declarations = Declarations.new end |
Instance Attribute Details
#declarations ⇒ Declarations
7 8 9 |
# File 'lib/habaki/style_rule.rb', line 7 def declarations @declarations end |
Instance Method Details
#element_match?(element) ⇒ Boolean
does rule match Visitor::Element ?
17 18 19 |
# File 'lib/habaki/style_rule.rb', line 17 def element_match?(element) selectors.element_match?(element) end |
#read_from_katana(rule) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
30 31 32 33 |
# File 'lib/habaki/style_rule.rb', line 30 def read_from_katana(rule) @selectors = Selectors.read_from_katana(rule.selectors) @declarations = Declarations.read_from_katana(rule.declarations) end |