| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Net::Google::CivicInformation; |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = '1.9901'; |
|
4
|
|
|
|
|
|
|
|
|
5
|
3
|
|
|
3
|
|
265038
|
use strict; |
|
|
3
|
|
|
|
|
8
|
|
|
|
3
|
|
|
|
|
136
|
|
|
6
|
3
|
|
|
3
|
|
17
|
use warnings; |
|
|
3
|
|
|
|
|
6
|
|
|
|
3
|
|
|
|
|
499
|
|
|
7
|
3
|
|
|
3
|
|
45
|
use v5.10; |
|
|
3
|
|
|
|
|
13
|
|
|
8
|
|
|
|
|
|
|
|
|
9
|
3
|
|
|
3
|
|
34
|
use Carp 'croak'; |
|
|
3
|
|
|
|
|
9
|
|
|
|
3
|
|
|
|
|
231
|
|
|
10
|
3
|
|
|
3
|
|
3662
|
use HTTP::Tiny; |
|
|
3
|
|
|
|
|
188265
|
|
|
|
3
|
|
|
|
|
178
|
|
|
11
|
3
|
|
|
3
|
|
726
|
use Types::Common::String 'NonEmptyStr'; |
|
|
3
|
|
|
|
|
205773
|
|
|
|
3
|
|
|
|
|
44
|
|
|
12
|
3
|
|
|
3
|
|
4369
|
use Moo; |
|
|
3
|
|
|
|
|
11723
|
|
|
|
3
|
|
|
|
|
32
|
|
|
13
|
3
|
|
|
3
|
|
4306
|
use namespace::clean; |
|
|
3
|
|
|
|
|
30797
|
|
|
|
3
|
|
|
|
|
58
|
|
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
## |
|
16
|
|
|
|
|
|
|
has api_key => ( |
|
17
|
|
|
|
|
|
|
is => 'ro', |
|
18
|
|
|
|
|
|
|
isa => NonEmptyStr, |
|
19
|
|
|
|
|
|
|
required => 1, |
|
20
|
|
|
|
|
|
|
default => sub { $ENV{GOOGLE_API_KEY} }, |
|
21
|
|
|
|
|
|
|
); |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
## |
|
24
|
|
|
|
|
|
|
has _api_url => ( |
|
25
|
|
|
|
|
|
|
is => 'lazy', |
|
26
|
0
|
|
|
0
|
|
0
|
builder => sub { croak 'this method must be overriden in a subclass' }, |
|
27
|
|
|
|
|
|
|
init_arg => undef, |
|
28
|
|
|
|
|
|
|
coerce => sub { 'https://www.googleapis.com/civicinfo/v2/' . $_[0] }, |
|
29
|
|
|
|
|
|
|
); |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
## |
|
32
|
|
|
|
|
|
|
has _client => ( |
|
33
|
|
|
|
|
|
|
is => 'lazy', |
|
34
|
|
|
|
|
|
|
init_arg => undef, |
|
35
|
|
|
|
|
|
|
builder => sub { |
|
36
|
1
|
|
|
1
|
|
1163
|
state $ua = HTTP::Tiny->new; |
|
37
|
1
|
|
|
|
|
197
|
return $ua; |
|
38
|
|
|
|
|
|
|
}, |
|
39
|
|
|
|
|
|
|
); |
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; # return true |
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
__END__ |