Class: SyntaxTree::CSS::CDOToken

Inherits:
Node
  • Object
show all
Defined in:
lib/syntax_tree/css/nodes.rb

Overview

A parsed token containing a CDO (<!–). www.w3.org/TR/css-syntax-3/#typedef-cdo-token

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#format, #pretty_print

Constructor Details

#initialize(location:) ⇒ CDOToken

Returns a new instance of CDOToken.



174
175
176
# File 'lib/syntax_tree/css/nodes.rb', line 174

def initialize(location:)
  @location = Location.from(location)
end

Instance Attribute Details

#locationObject (readonly)

Returns the value of attribute location.



172
173
174
# File 'lib/syntax_tree/css/nodes.rb', line 172

def location
  @location
end

Instance Method Details

#accept(visitor) ⇒ Object



178
179
180
# File 'lib/syntax_tree/css/nodes.rb', line 178

def accept(visitor)
  visitor.visit_cdo_token(self)
end

#child_nodesObject Also known as: deconstruct



182
183
184
# File 'lib/syntax_tree/css/nodes.rb', line 182

def child_nodes
  []
end

#deconstruct_keys(keys) ⇒ Object



188
189
190
# File 'lib/syntax_tree/css/nodes.rb', line 188

def deconstruct_keys(keys)
  { location: location }
end