line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Geo::Coder::Many::Generic; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
15
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
65
|
|
4
|
2
|
|
|
2
|
|
14
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
48
|
|
5
|
2
|
|
|
2
|
|
11
|
use Carp; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
133
|
|
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
1220
|
use Geo::Coder::Many::Response; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
312
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=head1 NAME |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
Geo::Coder::Many::Generic - Base plugin class |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
=head1 DESCRIPTION |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
Base class for Geo::Coder::Many::* (Geo::Coder wrapper) classes |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 METHODS |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
=head2 new |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
Construct and return a new instance of the class. |
24
|
|
|
|
|
|
|
Arguments should be provided in a hash with keys 'geocoder' and 'daily_limit'. |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=cut |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub new { |
29
|
0
|
|
|
0
|
1
|
|
my $class = shift; |
30
|
0
|
|
|
|
|
|
my $args = shift; |
31
|
|
|
|
|
|
|
|
32
|
0
|
|
|
|
|
|
my $self = { |
33
|
|
|
|
|
|
|
GeoCoder => $args->{geocoder}, |
34
|
|
|
|
|
|
|
daily_limit => $args->{daily_limit}, |
35
|
|
|
|
|
|
|
}; |
36
|
|
|
|
|
|
|
|
37
|
0
|
|
|
|
|
|
bless $self, $class; |
38
|
|
|
|
|
|
|
|
39
|
0
|
|
|
|
|
|
return $self; |
40
|
|
|
|
|
|
|
}; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head2 geocode |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
The main geocode method, to be overridden by subclasses. Should take a location |
45
|
|
|
|
|
|
|
string, geocode it using the wrapped class, and return the results (converted |
46
|
|
|
|
|
|
|
to a standard format) |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=cut |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub geocode { |
51
|
0
|
|
|
0
|
1
|
|
croak "This method must be over-ridden"; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head2 get_daily_limit |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
Getter for daily_limit. |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=cut |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
sub get_daily_limit { |
61
|
0
|
|
|
0
|
1
|
|
return shift->{daily_limit}; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head2 get_name |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
Return the short name of the geocoder being wrapped (should be overriden by the |
67
|
|
|
|
|
|
|
subclass) |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=cut |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
sub get_name { |
72
|
0
|
|
|
0
|
1
|
|
croak "This method must be over-ridden"; |
73
|
|
|
|
|
|
|
}; |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
1; |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
__END__ |