Class: LibRubyParser::Nodes::Gvasgn

Inherits:
LibRubyParser::Node show all
Defined in:
lib/lib-ruby-parser/nodes.rb

Overview

Represents global variable assignment (i.e. $foo = 42)

Instance Attribute Summary collapse

Instance Attribute Details

#expression_lLoc (readonly)

Location of the full expression

$foo = 42
~~~~~~~~~

Returns:



1655
1656
1657
# File 'lib/lib-ruby-parser/nodes.rb', line 1655

def expression_l
  @expression_l
end

#nameString (readonly)

Name of the global variable, String("$foo") for $foo

Returns:

  • (String)


1618
1619
1620
# File 'lib/lib-ruby-parser/nodes.rb', line 1618

def name
  @name
end

#name_lLoc (readonly)

Location of the global variable name

$foo = 42
~~~~

Returns:



1634
1635
1636
# File 'lib/lib-ruby-parser/nodes.rb', line 1634

def name_l
  @name_l
end

#operator_lLoc? (readonly)

Location of the = operator

$foo = 42
     ~

None if global variable assignment is a part of the multi-assignment. In such case = operator belongs to the Masgn node.

Returns:



1646
1647
1648
# File 'lib/lib-ruby-parser/nodes.rb', line 1646

def operator_l
  @operator_l
end

#valueNode? (readonly)

Value that is assigned to global variable, Int("42") for $foo = 42

None if global variable assignment is a part of the multi-assignment. In such case value is a part of the Masgn node.

Returns:



1625
1626
1627
# File 'lib/lib-ruby-parser/nodes.rb', line 1625

def value
  @value
end