blib/lib/Geo/UK/Postcode/Regex/Hash.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 5 | 5 | 100.0 |
branch | n/a | ||
condition | 2 | 3 | 66.6 |
subroutine | 2 | 2 | 100.0 |
pod | n/a | ||
total | 9 | 10 | 90.0 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package Geo::UK::Postcode::Regex::Hash; | ||||||
2 | |||||||
3 | our $VERSION = '0.015'; | ||||||
4 | |||||||
5 | require Tie::Hash; | ||||||
6 | |||||||
7 | our @ISA = qw/ Tie::StdHash /; | ||||||
8 | |||||||
9 | sub TIEHASH { | ||||||
10 | 7 | 7 | 22 | my $class = shift; | |||
11 | 7 | 65 | return bless {@_}, $class; | ||||
12 | } | ||||||
13 | |||||||
14 | sub FETCH { | ||||||
15 | 34166 | 34166 | 72037 | my ( $this, $key ) = @_; | |||
16 | 34166 | 66 | 83871 | $this->{$key} //= $this->{_fetch}->($key); | |||
17 | 34166 | 323780 | return $this->{$key}; | ||||
18 | } | ||||||
19 | |||||||
20 | 1; | ||||||
21 |