File Coverage

blib/lib/HTTP/MobileAgent/Plugin/Locator/Willcom/BasicLocation.pm
Criterion Covered Total %
statement 12 12 100.0
branch n/a
condition 2 4 50.0
subroutine 4 4 100.0
pod 1 1 100.0
total 19 21 90.4


line stmt bran cond sub pod time code
1             package HTTP::MobileAgent::Plugin::Locator::Willcom::BasicLocation;
2              
3 1     1   6 use strict;
  1         1  
  1         38  
4 1     1   5 use base qw( HTTP::MobileAgent::Plugin::Locator );
  1         2  
  1         92  
5 1     1   4 use Geo::Coordinates::Converter;
  1         2  
  1         9  
6              
7             sub get_location {
8 4     4 1 6 my ( $self, $params ) = @_;
9 4         23 my ( $lat, $lng ) = $params->{ pos } =~ /^N([^E]+)E(.+)$/;
10 4   50     30 return Geo::Coordinates::Converter->new(
      50        
11             lat => $lat || undef,
12             lng => $lng || undef,
13             datum => 'tokyo',
14             )->convert( 'wgs84' );
15             }
16              
17             1;