File Coverage

blib/lib/String/Normal/Config/States.pm
Criterion Covered Total %
statement 10 10 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod n/a
total 14 14 100.0


line stmt bran cond sub pod time code
1             package String::Normal::Config::States;
2 9     9   29 use strict;
  9         10  
  9         208  
3 9     9   25 use warnings;
  9         12  
  9         184  
4              
5 9     9   51 use String::Normal::Config;
  9         22  
  9         1758  
6              
7             our $us_codes = {
8             ak => 'alaska',
9             al => 'alabama',
10             ar => 'arkansas',
11             as => 'american samoa',
12             az => 'arizona',
13             ca => 'california',
14             co => 'colorado',
15             ct => 'connecticut',
16             dc => 'district of columbia',
17             de => 'delaware',
18             fl => 'florida',
19             fm => 'federated states of micronesia',
20             ga => 'georgia',
21             gu => 'guam',
22             hi => 'hawaii',
23             ia => 'iowa',
24             id => 'idaho',
25             il => 'illinois',
26             in => 'indiana',
27             ks => 'kansas',
28             ky => 'kentucky',
29             la => 'louisiana',
30             ma => 'massachusetts',
31             md => 'maryland',
32             me => 'maine',
33             mh => 'marshall islands',
34             mi => 'michigan',
35             mn => 'minnesota',
36             mo => 'missouri',
37             mp => 'northern mariana islands',
38             ms => 'mississippi',
39             mt => 'montana',
40             nc => 'north carolina',
41             nd => 'north dakota',
42             ne => 'nebraska',
43             nh => 'new hampshire',
44             nj => 'new jersey',
45             nm => 'new mexico',
46             nv => 'nevada',
47             ny => 'new york',
48             oh => 'ohio',
49             ok => 'oklahoma',
50             or => 'oregon',
51             pa => 'pennsylvania',
52             pr => 'puerto rico',
53             pw => 'palau',
54             ri => 'rhode island',
55             sc => 'south carolina',
56             sd => 'south dakota',
57             tn => 'tennessee',
58             tx => 'texas',
59             ut => 'utah',
60             va => 'virginia',
61             vi => 'virgin islands',
62             vt => 'vermont',
63             wa => 'washington',
64             wi => 'wisconsin',
65             wv => 'west virginia',
66             wy => 'wyoming',
67             };
68              
69             our $ca_codes = {
70             ab => 'alberta',
71             bc => 'british columbia',
72             mb => 'manitoba',
73             nb => 'new brunswick',
74             nl => 'newfoundland and labrador',
75             ns => 'nova scotia',
76             nt => 'northwest territories',
77             nu => 'nunavut',
78             on => 'ontario',
79             pe => 'prince edward island',
80             qc => 'quebec',
81             sk => 'saskatchewan',
82             yt => 'yukon territory',
83             };
84              
85             our $by_short = { %$us_codes, %$ca_codes };
86             our $by_long = { reverse %$by_short };
87              
88             #our $to_country = {
89             # %{{ map { $_ => 'US' } keys %$us_codes }},
90             # %{{ map { $_ => 'CA' } keys %$ca_codes }},
91             #};
92              
93             sub _data {
94             return {
95 1     1   5 us_codes => $us_codes,
96             ca_codes => $ca_codes,
97             by_short => $by_short,
98             by_long => $by_long,
99             };
100             }
101              
102             1;
103              
104             =head1 NAME
105              
106             String::Normal::Config::States;
107              
108             =head1 DESCRIPTION
109              
110             This package defines valid U.S. and Candadian state codes.
111              
112             =head1 STRUCTURE
113              
114             Unless the other Config classes, this one provides a hash reference
115             which contains:
116              
117             =over 4
118              
119             =item * C
120              
121             All valid US codes.
122              
123             =item * C
124              
125             All valid CA codes.
126              
127             =item * C
128              
129             All codes with their short version as the key.
130              
131             =item * C
132              
133             All codes with their long version as the key.
134              
135             =back
136              
137             This Config class cannot be overriden.
138              
139             =head1 AUTHOR
140              
141             Jeff Anderson, C<< >>
142              
143             =head1 LICENSE AND COPYRIGHT
144              
145             Copyright 2017 Jeff Anderson.
146              
147             This program is free software; you can redistribute it and/or modify it
148             under the terms of the the Artistic License (2.0). You may obtain a
149             copy of the full license at:
150              
151             L
152              
153             Any use, modification, and distribution of the Standard or Modified
154             Versions is governed by this Artistic License. By using, modifying or
155             distributing the Package, you accept this license. Do not use, modify,
156             or distribute the Package, if you do not accept this license.
157              
158             If your Modified Version has been derived from a Modified Version made
159             by someone other than you, you are nevertheless required to ensure that
160             your Modified Version complies with the requirements of this license.
161              
162             This license does not grant you the right to use any trademark, service
163             mark, tradename, or logo of the Copyright Holder.
164              
165             This license includes the non-exclusive, worldwide, free-of-charge
166             patent license to make, have made, use, offer to sell, sell, import and
167             otherwise transfer the Package with respect to any patent claims
168             licensable by the Copyright Holder that are necessarily infringed by the
169             Package. If you institute patent litigation (including a cross-claim or
170             counterclaim) against any party alleging that the Package constitutes
171             direct or contributory patent infringement, then this Artistic License
172             to you shall terminate on the date that such litigation is filed.
173              
174             Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER
175             AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
176             THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
177             PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY
178             YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR
179             CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR
180             CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE,
181             EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
182              
183             =cut