Bolts/Blueprint/Acquired.pm

filter: Statementstmt 100% 19 / 19 Branchbran 75.0% 3 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 100% 2 / 2 totaltotal 96.5% 28 / 29 CC 3 SCAR 6.9
CC
3
Cov
96%
builder
3.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.0
« Bolts/Injector/Setter.pm ↑ Summary Bolts/Injector/Store/Array.pm »
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
BranchTrueFalseTotal
$self->has_path ? : 177 0 177
34
35 177 my $return;
36 177 ▶ if ($self->has_locator) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->has_locator) { } 3 174 177
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__
« Bolts/Injector/Setter.pm ↑ Summary Bolts/Injector/Store/Array.pm »