NAME

Bolts::Blueprint::ParentBag - Retrieve the artifact's parent as the artifact

VERSION

version 0.143171

SYNOPSIS

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'),
        }),
    ],
);

DESCRIPTION

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.

ROLES

METHODS

builder

This grabs the parent bag and returns it.

exists

Always returns true.

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.