blib/lib/Class/MakeMethods/Emulator/accessors.pm

filter: Statementstmt 100% 23 / 23 Branchbran 100% 4 / 4 Conditioncond 100% 6 / 6 MC/DCmcdc 100% 3 / 3 Subroutinesub 100% 9 / 9 Podpod n/a totaltotal 100% 45 / 45 CC 6 SCAR 11.5
CC
6
Cov
100%
import
6.0
BEGIN
1.0
BEGIN
1.0
CRAP 3.1
« blib/lib/Class/MakeMethods/Template/Hash.pm ↑ Summary blib/lib/Class/MakeMethods/Utility/Inheritable.pm »
1 package Class::MakeMethods::Emulator::accessors;
2  
3 4 $VERSION = '0.02';
4  
5 4 ▶use Class::MakeMethods::Emulator '-isasubclass';
Subroutine BEGIN: called CC=1 SCAR=0.0
6 4 ▶use Class::MakeMethods::Template::Hash '-isasubclass';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 11 ▶sub _emulator_target { 'accessors' }
Subroutine _emulator_target: called CC=1 SCAR=0.0
9 7 ▶sub _accessor_type { 'scalar --get_set_chain' }
Subroutine _accessor_type: called CC=1 SCAR=0.0
10  
11 15 ▶sub import {
Subroutine import: called CC=6 SCAR=17.9
12 15 my $class = shift;
13
14 15 ▶ $class->_handle_namespace( $class->_emulator_target, $_[0] ) and shift;
Branch: 1 branch
BranchTrueFalseTotal
$class->_handle_namespace($class->_emulator_target, $_[0]) and shift() 4 11 15
15
16 15 foreach ( @_ ) {
17 10 ▶ die "invalid accessor - $_" unless ( /\A[a-z]\w+\z/i and
Branch: 1 branch
BranchTrueFalseTotal
unless /\A[a-z]\w+\z/i and $_ ne "DESTROY" and $_ ne "AUTOLOAD" 4 6 10
Condition100%6/6
/\A[a-z]\w+\z/i and $_ ne "DESTROY" and $_ ne "AUTOLOAD"
!ll&&!rl&&r
316
/\A[a-z]\w+\z/i and $_ ne "DESTROY"
!ll&&!rl&&r
217
MC/DC100%3/3
/\A[a-z]\w+\z/i and $_ ne "DESTROY" and $_ ne "AUTOLOAD"
/\A[a-z]\w+\z/i $_ ne "DESTROY" $_ ne "AUTOLOAD"
Truth table100%4/4
A and B and C
A= /\A[a-z]\w+\z/iB= $_ ne "DESTROY"C= $_ ne "AUTOLOAD"
ABCresult
0XX0
10X0
1100
1111
18 $_ ne 'DESTROY' and $_ ne 'AUTOLOAD' )
19 }
20
21 11 $class->make($class->_accessor_type => [@_]);
22 }
23  
24 ########################################################################
25  
26 package Class::MakeMethods::Emulator::accessors::chained;
27 4 @ISA = 'Class::MakeMethods::Emulator::accessors';
28 $INC{'Class/MakeMethods/Emulator/accessors/chained.pm'} =
29 4 $INC{'Class/MakeMethods/Emulator/accessors.pm'};
30  
31 2 ▶sub _emulator_target { 'accessors::chained' }
Subroutine _emulator_target: called CC=1 SCAR=0.0
32 2 ▶sub _accessor_type { 'scalar --get_set_chain' }
Subroutine _accessor_type: called CC=1 SCAR=0.0
33  
34 ########################################################################
35  
36 package Class::MakeMethods::Emulator::accessors::classic;
37 4 @ISA = 'Class::MakeMethods::Emulator::accessors';
38 $INC{'Class/MakeMethods/Emulator/accessors/classic.pm'} =
39 4 $INC{'Class/MakeMethods/Emulator/accessors.pm'};
40  
41 2 ▶sub _emulator_target { 'accessors::classic' }
Subroutine _emulator_target: called CC=1 SCAR=0.0
42 2 ▶sub _accessor_type { 'scalar' }
Subroutine _accessor_type: called CC=1 SCAR=0.0
43  
44 ########################################################################
45  
46 4 1;
47  
48 __END__
« blib/lib/Class/MakeMethods/Template/Hash.pm ↑ Summary blib/lib/Class/MakeMethods/Utility/Inheritable.pm »