NAME
Bolts::Role::Locator - Interface for locating artifacts in a bag
VERSION
version 0.143170
DESCRIPTION
This is the interface that any locator must implement. A locator's primary job is to provide a way to find artifacts within a bag or selection of bags. This performs the acquisition and resolution process.
The reference implementation of this interface is found in Bolts::Role::RootLocator.
REQUIRED METHODS
acquire
my $artifact = $loc->acquire(\@path);
Given a @path
of symbol names to traverse, this goes through each artifact in turn, resolves it, if necessary, and then continues to the next path component.
When complete, the complete, resolved artifact found is returned.
acquire_all
my @artifacts = @{ $loc->acquire_all(\@path) };
This is similar to acquire, but if the last bag is a reference to an array, then all the artifacts within that bag are acquired, resolved, and returned as a reference to an array.
If the last item found at the path is not an array, it returns an empty list.
resolve
my $resolved_artifact = $loc->resolve($bag, $artifact, \%options);
After the artifact has been found, this method resolves the a partial artifact implementing the Bolts::Role::Artifact and turns it into the complete artifact.
get
my $artifact = $log->get($component);
Given a single symbol name as the path component to find during acquisition it returns the partial artifact for it. This artifact is incomplete and still needs to be resolved.
AUTHOR
Andrew Sterling Hanenkamp <hanenkamp@cpan.org>
COPYRIGHT AND LICENSE
This software is copyright (c) 2014 by Qubling Software LLC.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.