Class: SyntaxTree::CSS::Selectors::TypeSelector
- Defined in:
- lib/syntax_tree/css/selectors.rb
Overview
A selector for a specific tag name. www.w3.org/TR/selectors-4/#typedef-type-selector
Instance Attribute Summary collapse
-
#prefix ⇒ Object
readonly
Returns the value of attribute prefix.
-
#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(prefix:, value:) ⇒ TypeSelector
constructor
A new instance of TypeSelector.
Methods inherited from Node
Constructor Details
#initialize(prefix:, value:) ⇒ TypeSelector
Returns a new instance of TypeSelector.
183 184 185 186 |
# File 'lib/syntax_tree/css/selectors.rb', line 183 def initialize(prefix:, value:) @prefix = prefix @value = value end |
Instance Attribute Details
#prefix ⇒ Object (readonly)
Returns the value of attribute prefix.
181 182 183 |
# File 'lib/syntax_tree/css/selectors.rb', line 181 def prefix @prefix end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
181 182 183 |
# File 'lib/syntax_tree/css/selectors.rb', line 181 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
188 189 190 |
# File 'lib/syntax_tree/css/selectors.rb', line 188 def accept(visitor) visitor.visit_type_selector(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
192 193 194 |
# File 'lib/syntax_tree/css/selectors.rb', line 192 def child_nodes [prefix, value] end |
#deconstruct_keys(keys) ⇒ Object
198 199 200 |
# File 'lib/syntax_tree/css/selectors.rb', line 198 def deconstruct_keys(keys) { prefix: prefix, value: value } end |