Class: SyntaxTree::CSS::ColonToken

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

Overview

A parsed token containing a colon. www.w3.org/TR/css-syntax-3/#typedef-colon-token

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#format, #pretty_print

Constructor Details

#initialize(location:) ⇒ ColonToken

Returns a new instance of ColonToken.



285
286
287
# File 'lib/syntax_tree/css/nodes.rb', line 285

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

Instance Attribute Details

#locationObject (readonly)

Returns the value of attribute location.



283
284
285
# File 'lib/syntax_tree/css/nodes.rb', line 283

def location
  @location
end

Instance Method Details

#accept(visitor) ⇒ Object



289
290
291
# File 'lib/syntax_tree/css/nodes.rb', line 289

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

#child_nodesObject Also known as: deconstruct



293
294
295
# File 'lib/syntax_tree/css/nodes.rb', line 293

def child_nodes
  []
end

#deconstruct_keys(keys) ⇒ Object



299
300
301
# File 'lib/syntax_tree/css/nodes.rb', line 299

def deconstruct_keys(keys)
  { location: location }
end