| 1 | package WebService::Heartrails::Express::Provider::Station; | ||||||||||||||||||||||||||||
| 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 | 2 | ▶ | use Carp; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 0 | ▶ | sub call{ | ||||||||||||||||||||||||||
|
Subroutine
call: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 8 | 0 | my($self,$class,$arg) = @_; | |||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | 0 | my $line = $arg->{line}; | |||||||||||||||||||||||||||
| 11 | 0 | my $name = $arg->{name}; | |||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | 0 | ▶ | unless(defined $line or defined $name){ | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $line or defined $name
MC/DC0%0/2
defined $line or defined $name
defined $line
defined $name
Truth table0%0/3
A or B
A= defined $lineB= defined $name
| |||||||||||||||||||||||||||||
| 14 | 0 | croak("line or name is either required"); | |||||||||||||||||||||||||||
| 15 | } | ||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | 0 | my $sub_url = do{ | |||||||||||||||||||||||||||
| 18 | 0 | ▶ | if(not defined $line){ | ||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 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 | 2 | 1; | |||||||||||||||||||||||||||