Property/RW/Custom.pm

filter: Statementstmt 100% 16 / 16 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod n/a totaltotal 100% 22 / 22 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Property/RO.pm ↑ Summary Property/RW/CustomGet.pm »
1 package Class::Property::RW::Custom;
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, $getter, $setter ) = @_;
8 1 return bless {
9 'getter' => $getter
10 , 'setter' => $setter
11 }, $class;
12 }
13
14 sub STORE
15 2 ▶{
Subroutine STORE: called CC=1 SCAR=0.0
16 2 my( $self, $value ) = @_;
17 2 $self->{'setter'}->($self->{'object'}, $value);
18 }
19
20 sub FETCH
21 2 ▶{
Subroutine FETCH: called CC=1 SCAR=0.0
22 2 my( $self ) = @_;
23 2 return $self->{'getter'}->($self->{'object'});
24 }
25
26 1 1;
« Property/RO.pm ↑ Summary Property/RW/CustomGet.pm »