Class: SyntaxTree::CSS::DelimToken

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

Overview

A parsed token that has a value composed of a single code point. www.w3.org/TR/css-syntax-3/#typedef-delim-token

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#format, #pretty_print

Constructor Details

#initialize(value:, location:) ⇒ DelimToken

Returns a new instance of DelimToken.



416
417
418
419
# File 'lib/syntax_tree/css/nodes.rb', line 416

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

Instance Attribute Details

#locationObject (readonly)

Returns the value of attribute location.



414
415
416
# File 'lib/syntax_tree/css/nodes.rb', line 414

def location
  @location
end

#valueObject (readonly)

Returns the value of attribute value.



414
415
416
# File 'lib/syntax_tree/css/nodes.rb', line 414

def value
  @value
end

Instance Method Details

#accept(visitor) ⇒ Object



421
422
423
# File 'lib/syntax_tree/css/nodes.rb', line 421

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

#child_nodesObject Also known as: deconstruct



425
426
427
# File 'lib/syntax_tree/css/nodes.rb', line 425

def child_nodes
  []
end

#deconstruct_keys(keys) ⇒ Object



431
432
433
# File 'lib/syntax_tree/css/nodes.rb', line 431

def deconstruct_keys(keys)
  { value: value, location: location }
end