class SyntaxTree::ConstPathField
object::Const = value
a child of another variable.
represents when you’re assigning to a constant that is being referenced as
ConstPathField represents the child node of some kind of assignment. It
def ===(other)
def ===(other) other.is_a?(ConstPathField) && parent === other.parent && constant === other.constant end
def accept(visitor)
def accept(visitor) visitor.visit_const_path_field(self) end
def child_nodes
def child_nodes [parent, constant] end
def copy(parent: nil, constant: nil, location: nil)
def copy(parent: nil, constant: nil, location: nil) node = ConstPathField.new( parent: parent || self.parent, constant: constant || self.constant, location: location || self.location ) node.comments.concat(comments.map(&:copy)) node end
def deconstruct_keys(_keys)
def deconstruct_keys(_keys) { parent: parent, constant: constant, location: location, comments: comments } end
def format(q)
def format(q) q.format(parent) q.text("::") q.format(constant) end
def initialize(parent:, constant:, location:)
def initialize(parent:, constant:, location:) @parent = parent @constant = constant @location = location @comments = [] end