line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WebService::Heartrails::Express::Provider::Near; |
2
|
2
|
|
|
2
|
|
10
|
use strict; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
61
|
|
3
|
2
|
|
|
2
|
|
8
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
44
|
|
4
|
2
|
|
|
2
|
|
10
|
use utf8; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
11
|
|
5
|
2
|
|
|
2
|
|
1234
|
use WebService::Heartrails::Express::Provider::Common; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
use Carp; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub call{ |
9
|
|
|
|
|
|
|
my($self,$class,$arg) = @_; |
10
|
|
|
|
|
|
|
my $x = $arg->{x}; |
11
|
|
|
|
|
|
|
my $y = $arg->{y}; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
unless(defined $x or defined $y){ |
14
|
|
|
|
|
|
|
croak("x or y is either required"); |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
my $sub_url =do{ |
18
|
|
|
|
|
|
|
if(not defined $x){ |
19
|
|
|
|
|
|
|
{method => 'getStations',y => $y}; |
20
|
|
|
|
|
|
|
}elsif(not defined $y){ |
21
|
|
|
|
|
|
|
{method => 'getStations',x => $x}; |
22
|
|
|
|
|
|
|
}else{ |
23
|
|
|
|
|
|
|
{method => 'getStations',x => $x,y => $y}; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
}; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my $content = WebService::Heartrails::Express::Provider::Common::call($class,$sub_url); |
28
|
|
|
|
|
|
|
return JSON::decode_json($content)->{response}->{station}; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
1; |