File Coverage

blib/lib/WWW/Google/Places/Geometry.pm
Criterion Covered Total %
statement 17 24 70.8
branch 0 2 0.0
condition n/a
subroutine 6 8 75.0
pod 0 2 0.0
total 23 36 63.8


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