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