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
#format, #pretty_print, #to_json
Constructor Details
#initialize(value:, location:) ⇒ SymbolContent
8310 8311 8312 8313 |
# File 'lib/syntax_tree/node.rb', line 8310 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
8308 8309 8310 |
# File 'lib/syntax_tree/node.rb', line 8308 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
8315 8316 8317 |
# File 'lib/syntax_tree/node.rb', line 8315 def accept(visitor) visitor.visit_symbol_content(self) end |
#child_nodes ⇒ Object Also known as: deconstruct
8319 8320 8321 |
# File 'lib/syntax_tree/node.rb', line 8319 def child_nodes [] end |
#deconstruct_keys(keys) ⇒ Object
8325 8326 8327 |
# File 'lib/syntax_tree/node.rb', line 8325 def deconstruct_keys(keys) { value: value, location: location } end |