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 | 20 | my $class = shift; | |||
11 | 7 | 56 | return bless {@_}, $class; | ||||
12 | } | ||||||
13 | |||||||
14 | sub FETCH { | ||||||
15 | 34148 | 34148 | 51418 | my ( $this, $key ) = @_; | |||
16 | 34148 | 66 | 98253 | $this->{$key} //= $this->{_fetch}->($key); | |||
17 | 34148 | 430339 | return $this->{$key}; | ||||
18 | } | ||||||
19 | |||||||
20 | 1; | ||||||
21 |