Class: SyntaxTree::SymbolContent

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

Overview

SymbolContent represents symbol contents and is always the child of a SymbolLiteral node.

:symbol

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#child_nodes, #deconstruct, #deconstruct_keys, #format, #pretty_print, #to_json

Constructor Details

#initialize(value:, location:) ⇒ SymbolContent

Returns a new instance of SymbolContent.



9938
9939
9940
9941
# File 'lib/syntax_tree/node.rb', line 9938

def initialize(value:, location:)
  @value = value
  @location = location
end

Instance Attribute Details

#locationObject (readonly)

Location

the location of this node



9936
9937
9938
# File 'lib/syntax_tree/node.rb', line 9936

def location
  @location
end

#valueObject (readonly)

Backtick | Const | CVar | GVar | Ident | IVar | Kw | Op

the value of the

symbol



9933
9934
9935
# File 'lib/syntax_tree/node.rb', line 9933

def value
  @value
end