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 | 8 | 8 | 31 | my $class = shift; | |||
11 | 8 | 48 | return bless {@_}, $class; | ||||
12 | } | ||||||
13 | |||||||
14 | sub FETCH { | ||||||
15 | 40352 | 40352 | 88273 | my ( $this, $key ) = @_; | |||
16 | 40352 | 66 | 97852 | $this->{$key} //= $this->{_fetch}->($key); | |||
17 | 40352 | 371560 | return $this->{$key}; | ||||
18 | } | ||||||
19 | |||||||
20 | 1; | ||||||
21 |