File Coverage

blib/lib/WebService/Heartrails/Express/Provider/Common.pm
Criterion Covered Total %
statement 13 15 86.6
branch n/a
condition n/a
subroutine 5 5 100.0
pod n/a
total 18 20 90.0


line stmt bran cond sub pod time code
1             package WebService::Heartrails::Express::Provider::Common;
2 2     2   10 use strict;
  2         3  
  2         56  
3 2     2   8 use warnings;
  2         5  
  2         39  
4 2     2   10 use utf8;
  2         4  
  2         34  
5              
6 2     2   49 use constant API_ENDPOINT => 'http://express.heartrails.com/api/json?';
  2         3  
  2         157  
7 2     2   130651 use JSON;
  0            
  0            
8             use Encode;
9             use URI;
10              
11             sub call{
12             my($class,$sub_url) = @_;
13             my $uri = URI->new(API_ENDPOINT);
14             $uri->query_form(%$sub_url);
15             my $res = $class->furl->get($uri);
16             my $content = $res->content;
17             return $content;
18             }
19              
20             1;
21              
22              
23              
24