The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Bolts::Injector::Store::Array - Inject dependencies into array artifacts

VERSION

version 0.143171

SYNOPSIS

    artifact thing1 => (
        builder => sub { [] },
        indexes => [
            0 => value 'first',
            2 => value 'third',
            9 => value 'tenth',
        ],
    );

    my $counter = 0;
    artifact thing2 => (
        builder => sub { [ 'foo', 'bar' ] },
        push => [ value 'baz', builder { ++$counter } ],
    );

DESCRIPTION

Inject values into an array during resolution by index or just push.

ROLES

ATTRIBUTES

position

If this attribute is set to a number, then the injection will happen at that index. If it is not set, this injector performs a push instead.

METHODS

post_inject_value

Performs the injection of values into an array by index or push.

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.