blib/lib/Class/Property/WO/CustomSet.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 11 | 14 | 78.5 |
branch | n/a | ||
condition | n/a | ||
subroutine | 4 | 5 | 80.0 |
pod | n/a | ||
total | 15 | 19 | 78.9 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package Class::Property::WO::CustomSet; | ||||||
2 | 1 | 1 | 5 | use strict; use warnings FATAL => 'all'; | |||
1 | 1 | 2 | |||||
1 | 42 | ||||||
1 | 6 | ||||||
1 | 2 | ||||||
1 | 47 | ||||||
3 | 1 | 1 | 5 | use parent 'Class::Property::WO'; | |||
1 | 2 | ||||||
1 | 5 | ||||||
4 | |||||||
5 | sub TIESCALAR | ||||||
6 | { | ||||||
7 | 1 | 1 | 3 | my( $class, $field, $setter ) = @_; | |||
8 | 1 | 6 | return bless { | ||||
9 | 'field' => $field | ||||||
10 | , 'setter' => $setter | ||||||
11 | }, $class; | ||||||
12 | } | ||||||
13 | |||||||
14 | sub STORE | ||||||
15 | { | ||||||
16 | 0 | 0 | my( $self, $value ) = @_; | ||||
17 | 0 | $self->{'setter'}->($self->{'object'}, $value); | |||||
18 | 0 | return; | |||||
19 | } | ||||||
20 | |||||||
21 | 1; |