| 1 | package Bolts::Blueprint::Acquired; | ||||||||||
| 2 | 6 | $Bolts::Blueprint::Acquired::VERSION = '0.143171'; | |||||||||
| 3 | # ABSTRACT: acquire an artifact via a path and locator | ||||||||||
| 4 | |||||||||||
| 5 | 6 | ▶ | use Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 6 | with 'Bolts::Blueprint::Role::Injector'; | |||||||||
| 8 | |||||||||||
| 9 | 6 | ▶ | use Bolts::Util qw( locator_for ); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | |||||||||||
| 11 | |||||||||||
| 12 | 6 | has locator => ( | |||||||||
| 13 | is => 'ro', | ||||||||||
| 14 | does => 'Bolts::Role::Locator', | ||||||||||
| 15 | predicate => 'has_locator', | ||||||||||
| 16 | ); | ||||||||||
| 17 | |||||||||||
| 18 | |||||||||||
| 19 | 6 | has path => ( | |||||||||
| 20 | is => 'ro', | ||||||||||
| 21 | isa => 'ArrayRef[Str]', | ||||||||||
| 22 | predicate => 'has_path', | ||||||||||
| 23 | traits => [ 'Array' ], | ||||||||||
| 24 | handles => { | ||||||||||
| 25 | full_path => 'elements', | ||||||||||
| 26 | }, | ||||||||||
| 27 | ); | ||||||||||
| 28 | |||||||||||
| 29 | |||||||||||
| 30 | 177 | ▶ | sub builder { | ||||||||
|
Subroutine
builder: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||
| 31 | 177 | my ($self, $bag, $name) = @_; | |||||||||
| 32 | |||||||||||
| 33 | 177 | ▶ | my @path = $self->has_path ? $self->full_path : $name; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 34 | |||||||||||
| 35 | 177 | my $return; | |||||||||
| 36 | 177 | ▶ | if ($self->has_locator) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 37 | 3 | $return = $self->locator->acquire(@path); | |||||||||
| 38 | } | ||||||||||
| 39 | else { | ||||||||||
| 40 | 174 | $return = locator_for($bag)->acquire(@path); | |||||||||
| 41 | } | ||||||||||
| 42 | |||||||||||
| 43 | 177 | return $return; | |||||||||
| 44 | } | ||||||||||
| 45 | |||||||||||
| 46 | |||||||||||
| 47 | 42 | ▶ | sub exists { 1 } | ||||||||
|
Subroutine
exists: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 48 | |||||||||||
| 49 | 6 | __PACKAGE__->meta->make_immutable; | |||||||||
| 50 | |||||||||||
| 51 | __END__ | ||||||||||