| 1 | package WWW::Google::Places::SearchResult; | ||||||||||
| 2 | |||||||||||
| 3 | 8 | $WWW::Google::Places::SearchResult::VERSION = '0.35'; | |||||||||
| 4 | 8 | $WWW::Google::Places::SearchResult::AUTHORITY = 'cpan:MANWAR'; | |||||||||
| 5 | |||||||||||
| 6 | =head1 NAME | ||||||||||
| 7 | |||||||||||
| 8 | WWW::Google::Places::SearchResult - Placeholder for Search Result for WWW::Google::Places. | ||||||||||
| 9 | |||||||||||
| 10 | =head1 VERSION | ||||||||||
| 11 | |||||||||||
| 12 | Version 0.35 | ||||||||||
| 13 | |||||||||||
| 14 | =cut | ||||||||||
| 15 | |||||||||||
| 16 | 8 | ▶ | use 5.006; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 17 | 8 | ▶ | use Data::Dumper; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 18 | 8 | ▶ | use WWW::Google::Places::Geometry; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 19 | |||||||||||
| 20 | 8 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 21 | 8 | ▶ | use namespace::clean; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 22 | |||||||||||
| 23 | 8 | ▶ | use overload q{""} => 'as_string', fallback => 1; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 24 | |||||||||||
| 25 | 8 | has 'place_id' => (is => 'ro'); | |||||||||
| 26 | 8 | has 'name' => (is => 'ro'); | |||||||||
| 27 | 8 | has 'types' => (is => 'ro'); | |||||||||
| 28 | 8 | has 'geometry' => (is => 'ro'); | |||||||||
| 29 | 0 | ▶ | has 'icon' => (is => 'ro', default => sub { 'N/A' }); | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=1.2
| |||||||||||
| 30 | 0 | ▶ | has 'vicinity' => (is => 'ro', default => sub { 'N/A' }); | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=1.2
| |||||||||||
| 31 | 0 | ▶ | has 'scope' => (is => 'ro', default => sub { 'GOOGLE' }); | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=1.2
| |||||||||||
| 32 | |||||||||||
| 33 | sub BUILDARGS { | ||||||||||
| 34 | 0 | ▶ | my ($class, $args) = @_; | ||||||||
|
Subroutine
BUILDARGS: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 35 | |||||||||||
| 36 | 0 | ▶ | if (exists $args->{geometry}) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 37 | 0 | $args->{geometry} = WWW::Google::Places::Geometry->new($args->{geometry}); | |||||||||
| 38 | } | ||||||||||
| 39 | |||||||||||
| 40 | 0 | return $args; | |||||||||
| 41 | } | ||||||||||
| 42 | |||||||||||
| 43 | =head1 METHODS | ||||||||||
| 44 | |||||||||||
| 45 | =head2 place_id() | ||||||||||
| 46 | |||||||||||
| 47 | Returns the place id. | ||||||||||
| 48 | |||||||||||
| 49 | =head2 name() | ||||||||||
| 50 | |||||||||||
| 51 | Returns place name. | ||||||||||
| 52 | |||||||||||
| 53 | =head2 types() | ||||||||||
| 54 | |||||||||||
| 55 | Returns ref to a list of place types. | ||||||||||
| 56 | |||||||||||
| 57 | =head2 geometry() | ||||||||||
| 58 | |||||||||||
| 59 | Returns an object of type L<WWW::Google::Places::Geometry>. | ||||||||||
| 60 | |||||||||||
| 61 | =head2 icon() | ||||||||||
| 62 | |||||||||||
| 63 | Returns URL of the link to the place icon. | ||||||||||
| 64 | |||||||||||
| 65 | =head2 vicinity() | ||||||||||
| 66 | |||||||||||
| 67 | Returns the vicinity of place. | ||||||||||
| 68 | |||||||||||
| 69 | =head2 scope() | ||||||||||
| 70 | |||||||||||
| 71 | Returns the place search scope. | ||||||||||
| 72 | |||||||||||
| 73 | =cut | ||||||||||
| 74 | |||||||||||
| 75 | sub as_string { | ||||||||||
| 76 | 0 | ▶ | my ($self) = @_; | ||||||||
|
Subroutine
as_string: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 77 | |||||||||||
| 78 | 0 | my $search_result = ''; | |||||||||
| 79 | 0 | $search_result .= sprintf("Id : %s\n", $self->place_id); | |||||||||
| 80 | 0 | $search_result .= sprintf("Name : %s\n", $self->name); | |||||||||
| 81 | 0 | $search_result .= sprintf("Types : %s\n", join(", ", @{$self->types})); | |||||||||
| 82 | 0 | $search_result .= sprintf("Geometry: %s\n", $self->geometry); | |||||||||
| 83 | 0 | $search_result .= sprintf("Icon : %s\n", $self->icon); | |||||||||
| 84 | 0 | $search_result .= sprintf("Vicinity: %s\n", $self->vicinity); | |||||||||
| 85 | 0 | $search_result .= sprintf("Scope : %s", $self->scope); | |||||||||
| 86 | |||||||||||
| 87 | 0 | return $search_result; | |||||||||
| 88 | } | ||||||||||
| 89 | |||||||||||
| 90 | =head1 AUTHOR | ||||||||||
| 91 | |||||||||||
| 92 | Mohammad S Anwar, C<< <mohammad.anwar at yahoo.com> >> | ||||||||||
| 93 | |||||||||||
| 94 | =head1 REPOSITORY | ||||||||||
| 95 | |||||||||||
| 96 | L<https://github.com/manwar/WWW-Google-Places> | ||||||||||
| 97 | |||||||||||
| 98 | =head1 BUGS | ||||||||||
| 99 | |||||||||||
| 100 | Please report any bugs or feature requests to C<bug-www-google-places at rt.cpan.org>, | ||||||||||
| 101 | or through the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=WWW-Google-Places>. | ||||||||||
| 102 | I will be notified, and then you'll automatically be notified of progress on your | ||||||||||
| 103 | bug as I make changes. | ||||||||||
| 104 | |||||||||||
| 105 | =head1 SUPPORT | ||||||||||
| 106 | |||||||||||
| 107 | You can find documentation for this module with the perldoc command. | ||||||||||
| 108 | |||||||||||
| 109 | perldoc WWW::Google::Places::SearchResult | ||||||||||
| 110 | |||||||||||
| 111 | You can also look for information at: | ||||||||||
| 112 | |||||||||||
| 113 | =over 4 | ||||||||||
| 114 | |||||||||||
| 115 | =item * RT: CPAN's request tracker (report bugs here) | ||||||||||
| 116 | |||||||||||
| 117 | L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=WWW-Google-Places> | ||||||||||
| 118 | |||||||||||
| 119 | =item * AnnoCPAN: Annotated CPAN documentation | ||||||||||
| 120 | |||||||||||
| 121 | L<http://annocpan.org/dist/WWW-Google-Places> | ||||||||||
| 122 | |||||||||||
| 123 | =item * CPAN Ratings | ||||||||||
| 124 | |||||||||||
| 125 | L<http://cpanratings.perl.org/d/WWW-Google-Places> | ||||||||||
| 126 | |||||||||||
| 127 | =item * Search CPAN | ||||||||||
| 128 | |||||||||||
| 129 | L<http://search.cpan.org/dist/WWW-Google-Places/> | ||||||||||
| 130 | |||||||||||
| 131 | =back | ||||||||||
| 132 | |||||||||||
| 133 | =head1 LICENSE AND COPYRIGHT | ||||||||||
| 134 | |||||||||||
| 135 | Copyright (C) 2011 - 2016 Mohammad S Anwar. | ||||||||||
| 136 | |||||||||||
| 137 | This program is free software; you can redistribute it and/or modify it under | ||||||||||
| 138 | the terms of the the Artistic License (2.0). You may obtain a copy of the full | ||||||||||
| 139 | license at: | ||||||||||
| 140 | |||||||||||
| 141 | L<http://www.perlfoundation.org/artistic_license_2_0> | ||||||||||
| 142 | |||||||||||
| 143 | Any use, modification, and distribution of the Standard or Modified Versions is | ||||||||||
| 144 | governed by this Artistic License.By using, modifying or distributing the Package, | ||||||||||
| 145 | you accept this license. Do not use, modify, or distribute the Package, if you do | ||||||||||
| 146 | not accept this license. | ||||||||||
| 147 | |||||||||||
| 148 | If your Modified Version has been derived from a Modified Version made by someone | ||||||||||
| 149 | other than you,you are nevertheless required to ensure that your Modified Version | ||||||||||
| 150 | complies with the requirements of this license. | ||||||||||
| 151 | |||||||||||
| 152 | This license does not grant you the right to use any trademark, service mark, | ||||||||||
| 153 | tradename, or logo of the Copyright Holder. | ||||||||||
| 154 | |||||||||||
| 155 | This license includes the non-exclusive, worldwide, free-of-charge patent license | ||||||||||
| 156 | to make, have made, use, offer to sell, sell, import and otherwise transfer the | ||||||||||
| 157 | Package with respect to any patent claims licensable by the Copyright Holder that | ||||||||||
| 158 | are necessarily infringed by the Package. If you institute patent litigation | ||||||||||
| 159 | (including a cross-claim or counterclaim) against any party alleging that the | ||||||||||
| 160 | Package constitutes direct or contributory patent infringement,then this Artistic | ||||||||||
| 161 | License to you shall terminate on the date that such litigation is filed. | ||||||||||
| 162 | |||||||||||
| 163 | Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND | ||||||||||
| 164 | CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED | ||||||||||
| 165 | WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR | ||||||||||
| 166 | NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL LAW. UNLESS | ||||||||||
| 167 | REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, | ||||||||||
| 168 | INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE | ||||||||||
| 169 | OF THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||||||||||
| 170 | |||||||||||
| 171 | =cut | ||||||||||
| 172 | |||||||||||
| 173 | 8 | 1; # End of WWW::Google::Places::SearchResult | |||||||||