Skip to content
On this page
class · Ruby 4.0

Prism::GlobalVariableWriteNode

< Prism::Node 15 instance methods 2 class methods

Represents writing to a global variable.

$foo = 1
^^^^^^^^

Class methods 2

Instance methods 15

Attributes
Read

The name of the global variable, which is a $ followed by an identifier. Alternatively, it can be one of the special global variables designated by a symbol.

Example
$foo = :bar  # name `:$foo`

$_Test = 123 # name `:$_Test`
Read

The value to write to the global variable. It can be any non-void expression.

$foo = :bar
       ^^^^

$-xyz = 123
        ^^^