File Coverage

blib/lib/WWW/Google/Places/Params.pm
Criterion Covered Total %
statement 26 26 100.0
branch n/a
condition 2 3 66.6
subroutine 9 9 100.0
pod 0 1 0.0
total 37 39 94.8


line stmt bran cond sub pod time code
1             package WWW::Google::Places::Params;
2              
3             $WWW::Google::Places::Params::VERSION = '0.37';
4             $WWW::Google::Places::Params::AUTHORITY = 'cpan:MANWAR';
5              
6             =head1 NAME
7              
8             WWW::Google::Places::Params - Placeholder for parameters for WWW::Google::Places
9              
10             =head1 VERSION
11              
12             Version 0.37
13              
14             =head1 DESCRIPTION
15              
16             B
17              
18             =cut
19              
20 8     8   217 use 5.006;
  8         32  
21 8     8   46 use strict; use warnings;
  8     8   16  
  8         192  
  8         38  
  8         19  
  8         257  
22 8     8   48 use Data::Dumper;
  8         16  
  8         485  
23              
24 8     8   3461 use File::Share ':all';
  8         174380  
  8         1299  
25 8     8   4112 use Method::ParamValidator;
  8         1411391  
  8         341  
26              
27 8     8   3449 use parent 'Exporter';
  8         2379  
  8         49  
28             our @EXPORT_OK = qw(get_validator);
29              
30             sub get_validator {
31 3     3 0 501 my $validator = Method::ParamValidator->new( config => dist_file('WWW-Google-Places', 'method-config.json') );
32 3         68996 $validator->get_field('location')->check(\&_check_location);
33              
34 3         227 return $validator;
35             }
36              
37             #
38             #
39             # PRIVATE METHODS
40             sub _check_location {
41 5     5   492 my ($location) = @_;
42              
43 5         9 my ($latitude, $longitude);
44 5   66     72 return (defined $location
45             &&
46             ($location =~ /\,/)
47             &&
48             ((($latitude, $longitude) = split/\,/,$location,2)
49             &&
50             (($latitude =~ /^\-?\d+\.?\d+$/) && ($longitude =~ /^\-?\d+\.?\d+$/))
51             ));
52             };
53              
54             =head1 AUTHOR
55              
56             Mohammad S Anwar, C<< >>
57              
58             =head1 REPOSITORY
59              
60             L
61              
62             =head1 BUGS
63              
64             Please report any bugs or feature requests to C,
65             or through the web interface at L.
66             I will be notified, and then you'll automatically be notified of progress on your
67             bug as I make changes.
68              
69             =head1 SUPPORT
70              
71             You can find documentation for this module with the perldoc command.
72              
73             perldoc WWW::Google::Places::Params
74              
75             You can also look for information at:
76              
77             =over 4
78              
79             =item * RT: CPAN's request tracker (report bugs here)
80              
81             L
82              
83             =item * AnnoCPAN: Annotated CPAN documentation
84              
85             L
86              
87             =item * CPAN Ratings
88              
89             L
90              
91             =item * Search CPAN
92              
93             L
94              
95             =back
96              
97             =head1 LICENSE AND COPYRIGHT
98              
99             Copyright (C) 2011 - 2016 Mohammad S Anwar.
100              
101             This program is free software; you can redistribute it and/or modify it under
102             the terms of the the Artistic License (2.0). You may obtain a copy of the full
103             license at:
104              
105             L
106              
107             Any use, modification, and distribution of the Standard or Modified Versions is
108             governed by this Artistic License.By using, modifying or distributing the Package,
109             you accept this license. Do not use, modify, or distribute the Package, if you do
110             not accept this license.
111              
112             If your Modified Version has been derived from a Modified Version made by someone
113             other than you,you are nevertheless required to ensure that your Modified Version
114             complies with the requirements of this license.
115              
116             This license does not grant you the right to use any trademark, service mark,
117             tradename, or logo of the Copyright Holder.
118              
119             This license includes the non-exclusive, worldwide, free-of-charge patent license
120             to make, have made, use, offer to sell, sell, import and otherwise transfer the
121             Package with respect to any patent claims licensable by the Copyright Holder that
122             are necessarily infringed by the Package. If you institute patent litigation
123             (including a cross-claim or counterclaim) against any party alleging that the
124             Package constitutes direct or contributory patent infringement,then this Artistic
125             License to you shall terminate on the date that such litigation is filed.
126              
127             Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND
128             CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED
129             WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
130             NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL LAW. UNLESS
131             REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT,
132             INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE
133             OF THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
134              
135             =cut
136              
137             1; # End of WWW::Google::Places::Params