Board/Service/WithClass.pm

filter: Statementstmt 100% 20 / 20 Branchbran 100% 2 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 100% 27 / 27 CC 2 SCAR 2.9
CC
2
Cov
100%
__ANON__
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« Board/SetterInjection.pm ↑ Summary Board/Service/WithParameters.pm »
1 package Bread::Board::Service::WithClass;
2 70 our $AUTHORITY = 'cpan:STEVAN';
3 # ABSTRACT: role for services returning instances of a given class
4 70 $Bread::Board::Service::WithClass::VERSION = '0.37';
5 70 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 70 ▶use Module::Runtime ();
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 70 ▶use Bread::Board::Types;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 70 with 'Bread::Board::Service';
11  
12 70 has 'class' => (
13 is => 'rw',
14 isa => 'Str',
15 predicate => 'has_class',
16 );
17  
18 229 ▶before 'get' => sub {
Subroutine __ANON__: called CC=2 SCAR=6.9
19 229 my $self = shift;
20 229 ▶ Module::Runtime::require_module($self->class)
Branch: 1 branch
BranchTrueFalseTotal
if $self->has_class 183 46 229
21 if $self->has_class;
22 70 };
23  
24 70 ▶no Moose::Role; 1;
Subroutine BEGIN: called CC=1 SCAR=0.0
25  
26 __END__
« Board/SetterInjection.pm ↑ Summary Board/Service/WithParameters.pm »