Class Nodes.GlobalVariableWriteNode

java.lang.Object
org.prism.Nodes.Node
org.prism.Nodes.GlobalVariableWriteNode
Enclosing class:
Nodes

public static final class Nodes.GlobalVariableWriteNode extends Nodes.Node
 Represents writing to a global variable.

     $foo = 1
     ^^^^^^^^
 
  • Field Details

    • name

      public final org.jruby.RubySymbol name
       The 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

      public final Nodes.Node 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