Bolts::Injector::Store::Array - Inject dependencies into array artifacts
version 0.143171
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 } ], );
Inject values into an array during resolution by index or just push.
Bolts::Injector
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.
Performs the injection of values into an array by index or push.
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.