File Coverage

blib/lib/HTTP/MobileAgent/Plugin/Locator/SoftBank/GPS.pm
Criterion Covered Total %
statement 13 13 100.0
branch n/a
condition 1 2 50.0
subroutine 4 4 100.0
pod 1 1 100.0
total 19 20 95.0


line stmt bran cond sub pod time code
1             package HTTP::MobileAgent::Plugin::Locator::SoftBank::GPS;
2             # S!GPS
3              
4 1     1   5 use strict;
  1         2  
  1         39  
5 1     1   4 use base qw( HTTP::MobileAgent::Plugin::Locator );
  1         2  
  1         85  
6 1     1   5 use Geo::Coordinates::Converter;
  1         2  
  1         8  
7              
8             sub get_location {
9 4     4 1 6 my ( $self, $params ) = @_;
10 4         22 my ( $lat, $lng ) = $params->{ pos } =~ /^[NS]([\d\.]+)[EW]([\d\.]+)$/;
11 4   50     19 my $datum = $params->{ geo } || 'wgs84';
12 4         15 return Geo::Coordinates::Converter->new(
13             lat => $lat,
14             lng => $lng,
15             datum => $datum,
16             )->convert;
17             }
18              
19             1;