class YARP::ConstantPathTargetNode
^^^^^^^^ ^^^^^^^^
Foo::Foo, Bar::Bar = baz
Represents writing to a constant path in a context that doesn’t have an explicit value.
def accept(visitor)
def accept(visitor) visitor.visit_constant_path_target_node(self) end
def child_nodes
def child_nodes [parent, child] end
def comment_targets
def comment_targets [*parent, child, delimiter_loc] end
def copy(**params)
def copy(**params) ConstantPathTargetNode.new( params.fetch(:parent) { parent }, params.fetch(:child) { child }, params.fetch(:delimiter_loc) { delimiter_loc }, params.fetch(:location) { location }, ) end
def deconstruct_keys(keys)
def deconstruct_keys(keys) { parent: parent, child: child, delimiter_loc: delimiter_loc, location: location } end
def delimiter
def delimiter delimiter_loc.slice end
def initialize(parent, child, delimiter_loc, location)
def initialize(parent, child, delimiter_loc, location) @parent = parent @child = child @delimiter_loc = delimiter_loc @location = location end
def inspect(inspector = NodeInspector.new)
def inspect(inspector = NodeInspector.new) inspector << inspector.header(self) if (parent = self.parent).nil? inspector << "├── parent: ∅\n" else inspector << "├── parent:\n" inspector << parent.inspect(inspector.child_inspector("│ ")).delete_prefix(inspector.prefix) end inspector << "├── child:\n" inspector << inspector.child_node(child, "│ ") inspector << "└── delimiter_loc: #{inspector.location(delimiter_loc)}\n" inspector.to_str end