Class: SyntaxTree::SymbolContent
Overview
SymbolContent represents symbol contents and is always the child of a SymbolLiteral node.
:symbol
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
- Backtick | Const | CVar | GVar | Ident | IVar | Kw | Op
-
the value of the symbol.
Attributes inherited from Node
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
- #child_nodes ⇒ Object (also: #deconstruct)
- #deconstruct_keys(_keys) ⇒ Object
-
#initialize(value:, location:) ⇒ SymbolContent
constructor
A new instance of SymbolContent.
Methods inherited from Node
#construct_keys, #format, #pretty_print, #to_json
Constructor Details
#initialize(value:, location:) ⇒ SymbolContent
Returns a new instance of SymbolContent.
8538 8539 8540 8541 |
# File 'lib/syntax_tree/node.rb', line 8538 def initialize(value:, location:) @value = value @location = location end |
Instance Attribute Details
#value ⇒ Object (readonly)
- Backtick | Const | CVar | GVar | Ident | IVar | Kw | Op
-
the value of the
symbol
8536 8537 8538 |
# File 'lib/syntax_tree/node.rb', line 8536 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
8543 8544 8545 |
# File 'lib/syntax_tree/node.rb', line 8543 def accept(visitor) visitor.visit_symbol_content(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
8547 8548 8549 |
# File 'lib/syntax_tree/node.rb', line 8547 def child_nodes [] end |
#deconstruct_keys(_keys) ⇒ Object
8553 8554 8555 |
# File 'lib/syntax_tree/node.rb', line 8553 def deconstruct_keys(_keys) { value: value, location: location } end |