line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Geo::Address::Mail::UK; |
2
|
2
|
|
|
2
|
|
98096
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
60
|
|
3
|
2
|
|
|
2
|
|
9
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
61
|
|
4
|
2
|
|
|
2
|
|
1157
|
use Moose; |
|
2
|
|
|
|
|
903059
|
|
|
2
|
|
|
|
|
520
|
|
5
|
2
|
|
|
2
|
|
25485
|
use MooseX::Storage; |
|
2
|
|
|
|
|
64002
|
|
|
2
|
|
|
|
|
17
|
|
6
|
|
|
|
|
|
|
with qw(MooseX::Storage::Deferred); |
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
488
|
use Moose::Util::TypeConstraints; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
21
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
extends 'Geo::Address::Mail'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '0.02'; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
subtype 'Geo::Address::Mail::UKPostalCode', |
15
|
|
|
|
|
|
|
=> as 'Str', |
16
|
|
|
|
|
|
|
=> where { |
17
|
|
|
|
|
|
|
$_ =~ /^([A-PR-UWYZ]([0-9]{1,2}|([A-HK-Y][0-9]|[A-HK-Y][0-9]([0-9]|[ABEHMNPRV-Y]))|[0-9][A-HJKS-UW])\ [0-9][ABD-HJLNP-UW-Z]{2}|(GIR\ 0AA)|(SAN\ TA1)|(BFPO\ (C\/O\ )?[0-9]{1,4})|((ASCN|BBND|[BFS]IQQ|PCRN|STHL|TDCU|TKCA)\ 1ZZ))$/; |
18
|
|
|
|
|
|
|
}; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
has '+postal_code' => ( |
21
|
|
|
|
|
|
|
isa => 'Geo::Address::Mail::UKPostalCode' |
22
|
|
|
|
|
|
|
); |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
has 'building' => ( |
25
|
|
|
|
|
|
|
is => 'rw', |
26
|
|
|
|
|
|
|
isa => 'Str' |
27
|
|
|
|
|
|
|
); |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
has 'locality' => ( |
30
|
|
|
|
|
|
|
is => 'rw', |
31
|
|
|
|
|
|
|
isa => 'Str' |
32
|
|
|
|
|
|
|
); |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
35
|
2
|
|
|
2
|
|
4350
|
no Moose; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
12
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head1 NAME |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
Geo::Address::Mail::UK - A Mailing Address in the United Kingdom |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head1 SYNOPSIS |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
Geo::Address::Mail::UK is a subclass of L<Geo::Address::Mail> that provides |
45
|
|
|
|
|
|
|
specific validation and attributes for mailing addresses located in the United |
46
|
|
|
|
|
|
|
Kingdom. |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
use Geo::Address::Mail::UK; |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
my $add = Geo::Address::Mail::UK->new( |
51
|
|
|
|
|
|
|
name => 'Sherlock Holmes', |
52
|
|
|
|
|
|
|
street => '221b Baker St', |
53
|
|
|
|
|
|
|
city => 'London', |
54
|
|
|
|
|
|
|
postal_code => 'NW1 6XE' |
55
|
|
|
|
|
|
|
); |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
Geo::Address::Mail::UK has all the attributes of L<Geo::Address::Mail>. The |
60
|
|
|
|
|
|
|
following attributes are either modified or new. |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head2 postal_code |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
Postal codes are validated to conform to the Royal Mail standard. |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=head2 building |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
Addresses can have a building name between the name and the street address. |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head2 locality |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
Addresses have an optional locality added between the street address and the |
73
|
|
|
|
|
|
|
city name. |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=head1 AUTHOR |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
Andrew Nelson, C<< <anelson at cpan.org> >> |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head1 ACKNOWLEDGEMENTS |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
This software is copyright (c) 2011 by Infinity Interactive, Inc.. |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=cut |