Class: SyntaxTree::CSS::IdentToken

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

Overview

A parsed token that contains an plaintext identifier. www.w3.org/TR/css-syntax-3/#typedef-ident-token

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#format, #pretty_print

Constructor Details

#initialize(value:, location:) ⇒ IdentToken



578
579
580
581
# File 'lib/syntax_tree/css/nodes.rb', line 578

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

Instance Attribute Details

#locationObject (readonly)

Returns the value of attribute location.



576
577
578
# File 'lib/syntax_tree/css/nodes.rb', line 576

def location
  @location
end

#valueObject (readonly)

Returns the value of attribute value.



576
577
578
# File 'lib/syntax_tree/css/nodes.rb', line 576

def value
  @value
end

Instance Method Details

#accept(visitor) ⇒ Object



583
584
585
# File 'lib/syntax_tree/css/nodes.rb', line 583

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

#child_nodesObject Also known as: deconstruct



587
588
589
# File 'lib/syntax_tree/css/nodes.rb', line 587

def child_nodes
  []
end

#deconstruct_keys(keys) ⇒ Object



593
594
595
# File 'lib/syntax_tree/css/nodes.rb', line 593

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