Bolts::Role::Locator - Interface for locating artifacts in a bag
version 0.143170
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.
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.
@path
When complete, the complete, resolved artifact found is returned.
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.
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.
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.
Andrew Sterling Hanenkamp <hanenkamp@cpan.org>
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.
To install Bolts, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Bolts
CPAN shell
perl -MCPAN -e shell install Bolts
For more information on module installation, please visit the detailed CPAN module installation guide.