class SyntaxTree::GVar
GVar
represents a global variable literal.
$variable
Attributes
- String
-
the name of the global variable
Public Class Methods
Source
# File lib/syntax_tree/node.rb, line 5622 def initialize(value:, location:) @value = value @location = location @comments = [] end
Public Instance Methods
Source
# File lib/syntax_tree/node.rb, line 5657 def ===(other) other.is_a?(GVar) && value === other.value end
Source
# File lib/syntax_tree/node.rb, line 5628 def accept(visitor) visitor.visit_gvar(self) end
Source
# File lib/syntax_tree/node.rb, line 5632 def child_nodes [] end
Also aliased as: deconstruct
Source
# File lib/syntax_tree/node.rb, line 5636 def copy(value: nil, location: nil) node = GVar.new( value: value || self.value, location: location || self.location ) node.comments.concat(comments.map(&:copy)) node end
Source
# File lib/syntax_tree/node.rb, line 5649 def deconstruct_keys(_keys) { value: value, location: location, comments: comments } end