Class: SyntaxTree::CSS::AtKeywordToken
- Defined in:
- lib/syntax_tree/css/nodes.rb
Overview
A parsed token that is an identifier that starts with an @ sign. www.w3.org/TR/css-syntax-3/#typedef-at-keyword-token
Instance Attribute Summary collapse
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#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:, location:) ⇒ AtKeywordToken
constructor
A new instance of AtKeywordToken.
Methods inherited from Node
Constructor Details
#initialize(value:, location:) ⇒ AtKeywordToken
Returns a new instance of AtKeywordToken.
45 46 47 48 |
# File 'lib/syntax_tree/css/nodes.rb', line 45 def initialize(value:, location:) @value = value @location = Location.from(location) end |
Instance Attribute Details
#location ⇒ Object (readonly)
Returns the value of attribute location.
43 44 45 |
# File 'lib/syntax_tree/css/nodes.rb', line 43 def location @location end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
43 44 45 |
# File 'lib/syntax_tree/css/nodes.rb', line 43 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
50 51 52 |
# File 'lib/syntax_tree/css/nodes.rb', line 50 def accept(visitor) visitor.visit_at_keyword_token(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
54 55 56 |
# File 'lib/syntax_tree/css/nodes.rb', line 54 def child_nodes [] end |
#deconstruct_keys(keys) ⇒ Object
60 61 62 |
# File 'lib/syntax_tree/css/nodes.rb', line 60 def deconstruct_keys(keys) { value: value, location: location } end |