Express/Provider/Near.pm

filter: Statementstmt 83.3% 10 / 12 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod n/a totaltotal 87.5% 14 / 16 CC 1 SCAR 0.7
CC
1
Cov
83%
BEGIN
1.3
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« Express.pm ↑ Summary Express/Provider/Common.pm »
1 package WebService::Heartrails::Express::Provider::Near;
2 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 0 ▶use WebService::Heartrails::Express::Provider::Common;
Subroutine BEGIN: called CC=1 SCAR=2.6
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;
« Express.pm ↑ Summary Express/Provider/Common.pm »