instance method
Prism::ConstantPathNode#full_name_parts
full_name_parts
lib/prism/node_ext.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/prism/node_ext.rb, line 176
def full_name_parts
parts = [] #: Array[Symbol]
current = self #: node?
while current.is_a?(ConstantPathNode)
name = current.name
if name.nil?
raise MissingNodesInConstantPathError, "Constant path contains missing nodes. Cannot compute full name"
end
parts.unshift(name)
current = current.parent
end
if !current.is_a?(ConstantReadNode) && !current.nil?
raise DynamicPartsInConstantPathError, "Constant path contains dynamic parts. Cannot compute full name"
end
parts.unshift(current&.name || :"")
end
Returns the list of parts for the full name of this constant path. For example: [:Foo, :Bar]