Class: SyntaxTree::CSS::CDCToken

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

Overview

A parsed token containing a CDC (–>). www.w3.org/TR/css-syntax-3/#typedef-cdc-token

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#format, #pretty_print

Constructor Details

#initialize(location:) ⇒ CDCToken

Returns a new instance of CDCToken.



150
151
152
# File 'lib/syntax_tree/css/nodes.rb', line 150

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

Instance Attribute Details

#locationObject (readonly)

Returns the value of attribute location.



148
149
150
# File 'lib/syntax_tree/css/nodes.rb', line 148

def location
  @location
end

Instance Method Details

#accept(visitor) ⇒ Object



154
155
156
# File 'lib/syntax_tree/css/nodes.rb', line 154

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

#child_nodesObject Also known as: deconstruct



158
159
160
# File 'lib/syntax_tree/css/nodes.rb', line 158

def child_nodes
  []
end

#deconstruct_keys(keys) ⇒ Object



164
165
166
# File 'lib/syntax_tree/css/nodes.rb', line 164

def deconstruct_keys(keys)
  { location: location }
end