File Coverage

blib/lib/WWW/Google/Places/Review.pm
Criterion Covered Total %
statement 14 31 45.1
branch 0 2 0.0
condition n/a
subroutine 5 7 71.4
pod 0 2 0.0
total 19 42 45.2


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