Class: Dommy::Internal::SelectorAST::CompoundSelector
- Inherits:
-
Struct
- Object
- Struct
- Dommy::Internal::SelectorAST::CompoundSelector
- Defined in:
- lib/dommy/internal/selector_ast.rb
Instance Attribute Summary collapse
-
#pseudo_element ⇒ Object
Returns the value of attribute pseudo_element.
-
#subclass_selectors ⇒ Object
Returns the value of attribute subclass_selectors.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
Instance Attribute Details
#pseudo_element ⇒ Object
Returns the value of attribute pseudo_element
57 58 59 |
# File 'lib/dommy/internal/selector_ast.rb', line 57 def pseudo_element @pseudo_element end |
#subclass_selectors ⇒ Object
Returns the value of attribute subclass_selectors
57 58 59 |
# File 'lib/dommy/internal/selector_ast.rb', line 57 def subclass_selectors @subclass_selectors end |
#type ⇒ Object
Returns the value of attribute type
57 58 59 |
# File 'lib/dommy/internal/selector_ast.rb', line 57 def type @type end |
Instance Method Details
#specificity ⇒ Object
62 63 64 65 66 67 |
# File 'lib/dommy/internal/selector_ast.rb', line 62 def specificity sum = type ? type.specificity : ZERO subclass_selectors.each { |selector| sum += selector.specificity } sum += pseudo_element.specificity if pseudo_element sum end |
#without_pseudo_element ⇒ Object
58 59 60 |
# File 'lib/dommy/internal/selector_ast.rb', line 58 def without_pseudo_element self.class.new(type, subclass_selectors, nil) end |