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