| 1 | package Bolts::Injector::Store::Array; | ||||||||||
| 2 | 4 | $Bolts::Injector::Store::Array::VERSION = '0.143171'; | |||||||||
| 3 | # ABSTRACT: Inject dependencies into array artifacts | ||||||||||
| 4 | |||||||||||
| 5 | 4 | ▶ | use Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 4 | with 'Bolts::Injector'; | |||||||||
| 8 | |||||||||||
| 9 | |||||||||||
| 10 | 4 | has position => ( | |||||||||
| 11 | is => 'ro', | ||||||||||
| 12 | isa => 'Int', | ||||||||||
| 13 | predicate => 'has_position', | ||||||||||
| 14 | ); | ||||||||||
| 15 | |||||||||||
| 16 | |||||||||||
| 17 | 48 | ▶ | sub post_inject_value { | ||||||||
|
Subroutine
post_inject_value: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 18 | 48 | my ($self, $loc, $value, $array) = @_; | |||||||||
| 19 | 48 | ▶ | if ($self->has_position) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 20 | 4 | $array->[ $self->position ] = $value; | |||||||||
| 21 | } | ||||||||||
| 22 | else { | ||||||||||
| 23 | 44 | push @{ $array }, $value; | |||||||||
| 24 | } | ||||||||||
| 25 | } | ||||||||||
| 26 | |||||||||||
| 27 | 4 | __PACKAGE__->meta->make_immutable; | |||||||||
| 28 | |||||||||||
| 29 | __END__ | ||||||||||