Bolts::Blueprint::ParentBag - Retrieve the artifact's parent as the artifact
version 0.143170
use Bolts; # Using the usual sugar... artifact thing => ( ... parameters => { parent => self, }, ); # Or directly... my $meta = Bolts::Bag->start_bag; my $artifact = Bolts::Artifact->new( ... injectors => [ $meta->locator->acquire('injector', 'parameter_name', { key => 'parent', blueprint => $meta->locator->acquire('blueprint', 'parent_bag'), }), ], );
This is a blueprint for grabing the parent itself as the artifact.
Warning: If you cache this object with a scope, like "singleton", your application will leak memory. This may create a very difficult to track loop of references.
Bolts::Blueprint::Role::Injector
This grabs the parent bag and returns it.
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.