Bindgen::Graph::Path
Pathing logic for the graph. See Path.local to find a locally-qualified
path between two nodes. Or use .from to build a path from a string.
The structure doesn't store any origin by itself.
Constructors
Returns a new Path on path. All generic type arguments are removed,
unless generic is true.
Returns a new Path on path. All generic type arguments are removed,
unless generic is true.
Returns a new Path formed by concatenating the given paths. Each
path in the collection may correspond to more than one namespace level;
an empty collection produces a self-path.
Returns a new Path formed by concatenating the given paths. Each
path in the collection may correspond to more than one namespace level;
an empty collection produces a self-path.
Finds the local path to go from node to wants, in terms of constant resolution for Crystal.
Each call may perform multiple look-ups to ensure the resulting local path refers to wants unambiguously. If this cannot be done, a global path will be returned.
Instance methods
Returns the Path with the parts in range. The new Path is global
only if it includes the first part of this Path and this Path is
also global.
See Object#hash(hasher)
Combines the other path into this path. If the other path is global, simply returns other. Otherwise, the new path contains the parts from this path, followed by the parts from other.
Returns the local Path with only the last part in #nodes, thus
pointing at the child in #parent. Raises if this is an empty path.
Does a local look-up starting at base for path. The look-up will begin in base itself. If not found, it'll try to find the path by going up to the parent(s).
If the path starts with :: (An empty element), the look-up will
always start at the global scope. If path is exactly ::, the root
node (not the global root) is returned. Otherwise, the first part of
the path must be the name of the root node: ::RootName::And::So::On
instead of ::And::So::On.
If not found, returns nil. This method does not raise.
Returns the Path excluding the last part in #nodes, thus pointing
to the parent of this path. Returns a global path if this path is also
global. Raises if this is an empty path.
Returns a global path from this local path, starting look-up at base. Does a full look-up under the hood, thus, the path has to be valid.
If this is already a #global? path, it is returned without further
checks.