Class: SyntaxTree::CSS::CommentToken
- Defined in:
- lib/syntax_tree/css/nodes.rb
Overview
A parsed token that contains a comment. These aren’t actually declared in the spec because it assumes you can just drop them. We parse them into tokens, however, so that we can keep track of their location.
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:) ⇒ CommentToken
constructor
A new instance of CommentToken.
Methods inherited from Node
Constructor Details
#initialize(value:, location:) ⇒ CommentToken
Returns a new instance of CommentToken.
334 335 336 337 |
# File 'lib/syntax_tree/css/nodes.rb', line 334 def initialize(value:, location:) @value = value @location = Location.from(location) end |
Instance Attribute Details
#location ⇒ Object (readonly)
Returns the value of attribute location.
332 333 334 |
# File 'lib/syntax_tree/css/nodes.rb', line 332 def location @location end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
332 333 334 |
# File 'lib/syntax_tree/css/nodes.rb', line 332 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
339 340 341 |
# File 'lib/syntax_tree/css/nodes.rb', line 339 def accept(visitor) visitor.visit_comment_token(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
343 344 345 |
# File 'lib/syntax_tree/css/nodes.rb', line 343 def child_nodes [] end |
#deconstruct_keys(keys) ⇒ Object
349 350 351 |
# File 'lib/syntax_tree/css/nodes.rb', line 349 def deconstruct_keys(keys) { value: value, location: location } end |