File Coverage

blib/lib/WebService/PublicViewpoints.pm
Criterion Covered Total %
statement 18 24 75.0
branch n/a
condition n/a
subroutine 6 7 85.7
pod 0 1 0.0
total 24 32 75.0


line stmt bran cond sub pod time code
1             package WebService::PublicViewpoints;
2 1     1   6 use strict;
  1         2  
  1         78  
3             our $VERSION = '0.01';
4              
5             package WebService::PublicViewpoints::Point;
6 1     1   4869 use Object::Tiny qw{url country_code country state city lat lng};
  1         553  
  1         10  
7              
8             package WebService::PublicViewpoints;
9 1     1   1537 use URI;
  1         8129  
  1         41  
10 1     1   7 use constant APP_URI => URI->new("http://public-viewpoints.appspot.com/get_viewpoint");
  1         2  
  1         4  
11              
12 1     1   9891 use LWP::Simple;
  1         86189  
  1         12  
13 1     1   1615 use Text::CSV::Slurp;
  1         38206  
  1         167  
14              
15             sub find {
16 0     0 0   shift;
17 0           my $uri = APP_URI->clone;
18 0           $uri->query_form({@_, format => "csv"});
19 0           return map { WebService::PublicViewpoints::Point->new(%$_) } @{ Text::CSV::Slurp->load(string => "url,country_code,country,state,city,lat,lng,,\n" . get($uri)) }
  0            
  0            
20             }
21              
22             1;
23              
24             __END__