Bolts::Blueprint::Acquired - acquire an artifact via a path and locator
version 0.143171
use Bolts; # Using the usual sugar... these all use acquired blueprints artifact thing1; # acquired by attribute artifact thing2 => ( path => [ 'thing1' ], ); artifact thing3 => ( locator => $other_loc, path => [ 'other', 'thing' ], ); # Or for injection artifact thing4 => ( class => 'MyApp::Thing', parameters => { foo => dep('thing1'), # uses this blueprint }, ); # Or directly... my $meta = Bolts::Bag->start_bag; my $artifact = Bolts::Artifact->new( name => 'thing', blueprint => $meta->locator->acquire('blueprint', 'acquired', { path => [ 'myapp', 'settings', 'thing' ], locator => $other_loc, }, scope => $meta->locator->acquire('scope', singleton'), );
A blueprint for constructing the object by acquiring it from a Bolts::Role::Locator. This is handy for assembling complex bags in Bolts. It is also used as a convenient way of injecting dependencies into an artifact.
Bolts::Blueprint::Role::Injector
This is the Bolts::Role::Locator to acquire an artifact from. If none is given, the blueprint will use the bag the parent artifact is in as the locator.
This is the path within the locator to use for acquiring the artifact. If not given, the name of the parent artifact is used instead (which is primarily useful for injected dependencies and could lead to negative consquences, like looping forever, if used otherwise).
This implements the actual acquisition from the "locator" (or the bag the parent artifact is in) and "path" (or the name of the parent artifact).
Always returns true.
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.