class SyntaxTree::ConstRef
ConstRef
represents the name of the constant being used in a class or module declaration.
class Container end
Attributes
Const
-
the constant itself
Public Class Methods
Source
# File lib/syntax_tree/node.rb, line 4017 def initialize(constant:, location:) @constant = constant @location = location @comments = [] end
Public Instance Methods
Source
# File lib/syntax_tree/node.rb, line 4052 def ===(other) other.is_a?(ConstRef) && constant === other.constant end
Source
# File lib/syntax_tree/node.rb, line 4023 def accept(visitor) visitor.visit_const_ref(self) end
Source
# File lib/syntax_tree/node.rb, line 4027 def child_nodes [constant] end
Also aliased as: deconstruct
Source
# File lib/syntax_tree/node.rb, line 4031 def copy(constant: nil, location: nil) node = ConstRef.new( constant: constant || self.constant, location: location || self.location ) node.comments.concat(comments.map(&:copy)) node end
Source
# File lib/syntax_tree/node.rb, line 4044 def deconstruct_keys(_keys) { constant: constant, location: location, comments: comments } end