Property/RW/CustomGet.pm

filter: Statementstmt 100% 14 / 14 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 100% 19 / 19 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Property/RW/Custom.pm ↑ Summary Property/WO.pm »
1 package Class::Property::RW::CustomGet;
2 1 ▶use strict; use warnings FATAL => 'all';
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use parent 'Class::Property::RW';
Subroutine BEGIN: called CC=1 SCAR=0.0
4
5 sub TIESCALAR
6 1 ▶{
Subroutine TIESCALAR: called CC=1 SCAR=0.0
7 1 my( $class, $field, $getter ) = @_;
8 1 return bless {
9 'field' => $field
10 , 'getter' => $getter
11 }, $class;
12 }
13
14 sub FETCH
15 4 ▶{
Subroutine FETCH: called CC=1 SCAR=0.0
16 4 my( $self ) = @_;
17 4 return $self->{'getter'}->($self->{'object'});
18 }
19
20 1 1;
« Property/RW/Custom.pm ↑ Summary Property/WO.pm »