1. Prism::
  2. GlobalVariableTargetNode

class Prism::GlobalVariableTargetNode

Represents writing to a global variable in a context that doesn’t have an explicit value.

$foo, $bar = baz^^^^  ^^^^

Attributes

name[R]

attr_reader name:Symbol

Public Class Methods

Source
# File lib/prism/node.rb, line 8068definitialize(source,node_id,location,flags,name)@source =source@node_id =node_id@location =location@flags =flags@name =nameend

Initialize a newGlobalVariableTargetNode node.

Source
# File lib/prism/node.rb, line 8123defself.type:global_variable_target_nodeend

Return a symbol representation of this node type. SeeNode::type.

Public Instance Methods

Source
# File lib/prism/node.rb, line 8129def===(other)other.is_a?(GlobalVariableTargetNode)&&    (name===other.name)end

Implements case-equality for the node. This is effectively == but without comparing the value of locations. Locations are checked only for presence.

Source
# File lib/prism/node.rb, line 8077defaccept(visitor)visitor.visit_global_variable_target_node(self)end

def accept: (Visitor visitor) -> void

Source
# File lib/prism/node.rb, line 8082defchild_nodes  []end

defchild_nodes: () ->Array

Also aliased as:deconstruct
Source
# File lib/prism/node.rb, line 8092defcomment_targets  []#: Array[Prism::node | Location]end

defcomment_targets: () -> Array[Node | Location]

Source
# File lib/prism/node.rb, line 8087defcompact_child_nodes  []end

defcompact_child_nodes: () ->Array

Source
# File lib/prism/node.rb, line 8097defcopy(node_id:self.node_id,location:self.location,flags:self.flags,name:self.name)GlobalVariableTargetNode.new(source,node_id,location,flags,name)end

def copy: (?node_id:Integer, ?location:Location, ?flags:Integer, ?name:Symbol) ->GlobalVariableTargetNode

def deconstruct: () ->Array

Alias for:child_nodes
Source
# File lib/prism/node.rb, line 8105defdeconstruct_keys(keys)  {node_id:node_id,location:location,name:name }end

defdeconstruct_keys: (Array keys) -> { node_id:Integer, location:Location, name:Symbol }

Source
# File lib/prism/node.rb, line 8113definspectInspectVisitor.compose(self)end

def inspect ->String

Source
# File lib/prism/node.rb, line 8118deftype:global_variable_target_nodeend

Return a symbol representation of this node type. SeeNode#type.