Board/Dependency.pm

filter: Statementstmt 100% 24 / 24 Branchbran 50.0% 2 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 93.9% 31 / 33 CC 3 SCAR 4.6
CC
3
Cov
93%
__ANON__
2.0
__ANON__
2.0
BEGIN
1.0
CRAP 1.6
« Board/LifeCycle/Singleton.pm ↑ Summary Board/SetterInjection.pm »
1 package Bread::Board::Dependency;
2 77 our $AUTHORITY = 'cpan:STEVAN';
3 # ABSTRACT: dependency for a service
4 77 $Bread::Board::Dependency::VERSION = '0.37';
5 77 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 77 ▶use Bread::Board::Service;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 77 with 'Bread::Board::Traversable';
10  
11 77 has 'service_path' => (
12 is => 'ro',
13 isa => 'Str',
14 predicate => 'has_service_path'
15 );
16  
17 has 'service_name' => (
18 is => 'ro',
19 isa => 'Str',
20 lazy => 1,
21 47 ▶ default => sub {
Subroutine __ANON__: called CC=2 SCAR=7.1
22 47 my $self = shift;
23 47 ▶ ($self->has_service_path)
Branch: 1 branch
BranchTrueFalseTotal
$self->has_service_path or confess("Could not determine service name without service path") 47 0 47
24 || confess "Could not determine service name without service path";
25 47 (split '/' => $self->service_path)[-1];
26 }
27 77 );
28  
29 77 has 'service_params' => (
30 is => 'ro',
31 isa => 'HashRef',
32 predicate => 'has_service_params'
33 );
34  
35 has 'service' => (
36 is => 'ro',
37 does => 'Bread::Board::Service | Bread::Board::Dependency',
38 lazy => 1,
39 109 ▶ default => sub {
Subroutine __ANON__: called CC=2 SCAR=7.1
40 109 my $self = shift;
41 109 ▶ ($self->has_service_path)
Branch: 1 branch
BranchTrueFalseTotal
$self->has_service_path or confess("Could not fetch service without service path") 109 0 109
42 || confess "Could not fetch service without service path";
43 109 $self->fetch($self->service_path);
44 },
45 77 handles => [ 'get', 'is_locked', 'lock', 'unlock' ]
46 );
47  
48 77 __PACKAGE__->meta->make_immutable;
49  
50 77 ▶no Moose; 1;
Subroutine BEGIN: called CC=1 SCAR=0.0
51  
52 __END__
« Board/LifeCycle/Singleton.pm ↑ Summary Board/SetterInjection.pm »