Class: LibRubyParser::Nodes::Gvasgn
- Inherits:
-
LibRubyParser::Node
- Object
- LibRubyParser::Node
- LibRubyParser::Nodes::Gvasgn
- Defined in:
- lib/lib-ruby-parser/nodes.rb
Overview
Represents global variable assignment (i.e. $foo = 42
)
Instance Attribute Summary collapse
-
#expression_l ⇒ Loc
readonly
Location of the full expression.
-
#name ⇒ String
readonly
Name of the global variable,
String("$foo")
for$foo
. -
#name_l ⇒ Loc
readonly
Location of the global variable name.
-
#operator_l ⇒ Loc?
readonly
Location of the
=
operator. -
#value ⇒ Node?
readonly
Value that is assigned to global variable,
Int("42")
for$foo = 42
.
Instance Attribute Details
#expression_l ⇒ Loc (readonly)
Location of the full expression
$foo = 42
~~~~~~~~~
1655 1656 1657 |
# File 'lib/lib-ruby-parser/nodes.rb', line 1655 def expression_l @expression_l end |
#name ⇒ String (readonly)
Name of the global variable, String("$foo")
for $foo
1618 1619 1620 |
# File 'lib/lib-ruby-parser/nodes.rb', line 1618 def name @name end |
#name_l ⇒ Loc (readonly)
Location of the global variable name
$foo = 42
~~~~
1634 1635 1636 |
# File 'lib/lib-ruby-parser/nodes.rb', line 1634 def name_l @name_l end |
#operator_l ⇒ Loc? (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.
1646 1647 1648 |
# File 'lib/lib-ruby-parser/nodes.rb', line 1646 def operator_l @operator_l end |
#value ⇒ Node? (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.
1625 1626 1627 |
# File 'lib/lib-ruby-parser/nodes.rb', line 1625 def value @value end |