Represents writing to a constant path in a context that doesn’t have an explicit value.

Foo::Foo, Bar::Bar = baz
^^^^^^^^  ^^^^^^^^
Attributes
Read

attr_reader parent: Prism::node?

Read

attr_reader name: Symbol?

Class Methods

Initialize a new ConstantPathTargetNode node.

Return a symbol representation of this node type. See ‘Node::type`.

Instance Methods

Implements case-equality for the node. This is effectively == but without comparing the value of locations. Locations are checked only for presence.

def accept: (Visitor visitor) -> void

Previously, we had a child node on this class that contained either a constant read or a missing node. To not cause a breaking change, we continue to supply that API.

def child_nodes: () -> Array[nil | Node]

def comment_targets: () -> Array[Node | Location]

def copy: (?node_id: Integer, ?location: Location, ?flags: Integer, ?parent: Prism::node?, ?name: Symbol?, ?delimiter_loc: Location, ?name_loc: Location) -> ConstantPathTargetNode

An alias for child_nodes

def deconstruct_keys: (Array keys) -> { node_id: Integer, location: Location, parent: Prism::node?, name: Symbol?, delimiter_loc: Location, name_loc: Location }

def delimiter: () -> String

attr_reader delimiter_loc: Location

Returns the full name of this constant path. For example: “Foo::Bar”

Returns the list of parts for the full name of this constant path. For example: [:Foo, :Bar]

def inspect -> String

attr_reader name_loc: Location

Save the delimiter_loc location using the given saved source so that it can be retrieved later.

Save the name_loc location using the given saved source so that it can be retrieved later.

Return a symbol representation of this node type. See ‘Node#type`.