Class: SyntaxTree::CSS::Selectors::IdSelector
- Defined in:
- lib/syntax_tree/css/selectors.rb
Overview
The ID of an element, e.g., #foo www.w3.org/TR/selectors-4/#typedef-id-selector
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
- #child_nodes ⇒ Object (also: #deconstruct)
- #deconstruct_keys(keys) ⇒ Object
-
#initialize(value:) ⇒ IdSelector
constructor
A new instance of IdSelector.
Methods inherited from Node
Constructor Details
#initialize(value:) ⇒ IdSelector
Returns a new instance of IdSelector.
83 84 85 |
# File 'lib/syntax_tree/css/selectors.rb', line 83 def initialize(value:) @value = value end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
81 82 83 |
# File 'lib/syntax_tree/css/selectors.rb', line 81 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
87 88 89 |
# File 'lib/syntax_tree/css/selectors.rb', line 87 def accept(visitor) visitor.visit_id_selector(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
91 92 93 |
# File 'lib/syntax_tree/css/selectors.rb', line 91 def child_nodes [value] end |
#deconstruct_keys(keys) ⇒ Object
97 98 99 |
# File 'lib/syntax_tree/css/selectors.rb', line 97 def deconstruct_keys(keys) { value: value } end |