class SyntaxTree::CVar
CVar
represents the use of a class variable.
@@variable
Attributes
- String
-
the name of the class variable
Public Class Methods
Source
# File lib/syntax_tree/node.rb, line 4068 def initialize(value:, location:) @value = value @location = location @comments = [] end
Public Instance Methods
Source
# File lib/syntax_tree/node.rb, line 4103 def ===(other) other.is_a?(CVar) && value === other.value end
Source
# File lib/syntax_tree/node.rb, line 4074 def accept(visitor) visitor.visit_cvar(self) end
Source
# File lib/syntax_tree/node.rb, line 4078 def child_nodes [] end
Also aliased as: deconstruct
Source
# File lib/syntax_tree/node.rb, line 4082 def copy(value: nil, location: nil) node = CVar.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 4095 def deconstruct_keys(_keys) { value: value, location: location, comments: comments } end