Class: SyntaxTree::CSS::Selectors::WqName
- Defined in:
- lib/syntax_tree/css/selectors.rb
Overview
The name of an element, e.g., foo
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#prefix ⇒ Object
readonly
Returns the value of attribute prefix.
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
- #child_nodes ⇒ Object (also: #deconstruct)
- #deconstruct_keys(keys) ⇒ Object
-
#initialize(prefix:, name:) ⇒ WqName
constructor
A new instance of WqName.
Methods inherited from Node
Constructor Details
#initialize(prefix:, name:) ⇒ WqName
Returns a new instance of WqName.
207 208 209 210 |
# File 'lib/syntax_tree/css/selectors.rb', line 207 def initialize(prefix:, name:) @prefix = prefix @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
205 206 207 |
# File 'lib/syntax_tree/css/selectors.rb', line 205 def name @name end |
#prefix ⇒ Object (readonly)
Returns the value of attribute prefix.
205 206 207 |
# File 'lib/syntax_tree/css/selectors.rb', line 205 def prefix @prefix end |
Instance Method Details
#accept(visitor) ⇒ Object
212 213 214 |
# File 'lib/syntax_tree/css/selectors.rb', line 212 def accept(visitor) visitor.visit_wqname(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
216 217 218 |
# File 'lib/syntax_tree/css/selectors.rb', line 216 def child_nodes [prefix, name] end |
#deconstruct_keys(keys) ⇒ Object
222 223 224 |
# File 'lib/syntax_tree/css/selectors.rb', line 222 def deconstruct_keys(keys) { prefix: prefix, name: name } end |