Class Nodes.GlobalVariableWriteNode
java.lang.Object
org.prism.Nodes.Node
org.prism.Nodes.GlobalVariableWriteNode
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal org.jruby.RubySymbolThe name of the global variable, which is a `$` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifier).final Nodes.NodeThe value to write to the global variable.Fields inherited from class org.prism.Nodes.Node
EMPTY_ARRAY, length, startOffset -
Constructor Summary
ConstructorsConstructorDescriptionGlobalVariableWriteNode(int startOffset, int length, org.jruby.RubySymbol name, Nodes.Node value) -
Method Summary
Modifier and TypeMethodDescription<T> Taccept(AbstractNodeVisitor<T> visitor) protected String<T> voidvisitChildNodes(AbstractNodeVisitor<T> visitor) Methods inherited from class org.prism.Nodes.Node
endOffset, hasNewLineFlag, setNewLineFlag, setNewLineFlag, toString
-
Field Details
-
name
public final org.jruby.RubySymbol nameThe name of the global variable, which is a `$` followed by an [identifier](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#identifier). Alternatively, it can be one of the special global variables designated by a symbol. $foo = :bar # name `:$foo` $_Test = 123 # name `:$_Test` -
value
The value to write to the global variable. It can be any [non-void expression](https://github.com/ruby/prism/blob/main/docs/parsing_rules.md#non-void-expression). $foo = :bar ^^^^ $-xyz = 123 ^^^
-
-
Constructor Details
-
GlobalVariableWriteNode
public GlobalVariableWriteNode(int startOffset, int length, org.jruby.RubySymbol name, Nodes.Node value)
-
-
Method Details
-
visitChildNodes
- Specified by:
visitChildNodesin classNodes.Node
-
childNodes
- Specified by:
childNodesin classNodes.Node
-
accept
- Specified by:
acceptin classNodes.Node
-
toString
- Specified by:
toStringin classNodes.Node
-