line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Geo::Coder::Many::Generic; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
10
|
use strict; |
|
2
|
|
|
|
|
1
|
|
|
2
|
|
|
|
|
43
|
|
4
|
2
|
|
|
2
|
|
5
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
33
|
|
5
|
2
|
|
|
2
|
|
5
|
use Carp; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
99
|
|
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
571
|
use Geo::Coder::Many::Response; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
237
|
|
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
|
|
|
|
|
|
|
my $self = { |
33
|
|
|
|
|
|
|
GeoCoder => $args->{geocoder}, |
34
|
|
|
|
|
|
|
daily_limit => $args->{daily_limit}, |
35
|
0
|
|
|
|
|
|
}; |
36
|
|
|
|
|
|
|
|
37
|
0
|
|
|
|
|
|
bless $self, $class; |
38
|
0
|
|
|
|
|
|
return $self; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=head2 geocode |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
The main geocode method, to be overridden by subclasses. Should take a location |
44
|
|
|
|
|
|
|
string, geocode it using the wrapped class, and return the results (converted |
45
|
|
|
|
|
|
|
to a standard format) |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=cut |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
sub geocode { |
50
|
0
|
|
|
0
|
1
|
|
croak "This method must be over-ridden"; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head2 get_daily_limit |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
Getter for daily_limit. |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=cut |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub get_daily_limit { |
60
|
0
|
|
|
0
|
1
|
|
return shift->{daily_limit}; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head2 get_name |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
Return the short name of the geocoder being wrapped (should be overriden by the |
66
|
|
|
|
|
|
|
subclass) |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=cut |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
sub get_name { |
71
|
0
|
|
|
0
|
1
|
|
croak "This method must be over-ridden"; |
72
|
|
|
|
|
|
|
}; |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
1; |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
__END__ |