File Coverage

blib/lib/WebService/Wikimapia/Street.pm
Criterion Covered Total %
statement 35 99 35.3
branch 0 22 0.0
condition n/a
subroutine 12 13 92.3
pod 0 1 0.0
total 47 135 34.8


line stmt bran cond sub pod time code
1             package WebService::Wikimapia::Street;
2              
3             $WebService::Wikimapia::Street::VERSION = '0.12';
4             $WebService::Wikimapia::Street::AUTHORITY = 'cpan:MANWAR';
5              
6             =head1 NAME
7              
8             WebService::Wikimapia::Street - Placeholder for 'street' of L.
9              
10             =head1 VERSION
11              
12             Version 0.12
13              
14             =cut
15              
16 7     7   140 use 5.006;
  7         17  
17 7     7   38 use Data::Dumper;
  7         9  
  7         318  
18 7     7   2484 use WebService::Wikimapia::City;
  7         16  
  7         205  
19 7     7   2723 use WebService::Wikimapia::Hotel;
  7         15  
  7         200  
20 7     7   38 use WebService::Wikimapia::Photo;
  7         9  
  7         113  
21 7     7   21 use WebService::Wikimapia::Place;
  7         8  
  7         99  
22 7     7   2555 use WebService::Wikimapia::User;
  7         14  
  7         168  
23 7     7   32 use WebService::Wikimapia::Comment;
  7         8  
  7         111  
24 7     7   22 use WebService::Wikimapia::Location;
  7         9  
  7         117  
25 7     7   2363 use WebService::Wikimapia::Language;
  7         11  
  7         187  
26              
27 7     7   34 use Moo;
  7         9  
  7         22  
28 7     7   1357 use namespace::clean;
  7         9  
  7         21  
29              
30             has 'id' => (is => 'ro');
31             has 'title' => (is => 'ro');
32             has 'photos' => (is => 'ro');
33             has 'language_id' => (is => 'ro');
34             has 'language_iso' => (is => 'ro');
35             has 'urlhtml' => (is => 'ro');
36             has 'object_type' => (is => 'ro');
37             has 'location' => (is => 'ro');
38             has 'comments' => (is => 'ro');
39             has 'lastEditors' => (is => 'ro');
40             has 'related' => (is => 'ro');
41             has 'nearestPlaces' => (is => 'ro');
42             has 'nearestComments' => (is => 'ro');
43             has 'nearestHotels' => (is => 'ro');
44             has 'nearestCities' => (is => 'ro');
45             has 'nearestStreets' => (is => 'ro');
46             has 'availableLanguages' => (is => 'ro');
47              
48             sub BUILDARGS {
49 0     0 0   my ($class, $args) = @_;
50              
51 0 0         if (exists $args->{'location'}) {
52 0           $args->{'location'} = WebService::Wikimapia::Location->new($args->{'location'});
53             }
54              
55 0 0         if (exists $args->{'comments'}) {
56 0           my $comments = [];
57 0           foreach my $comment (@{$args->{'comments'}}) {
  0            
58 0           push @$comments, WebService::Wikimapia::Comment->new($comment);
59             }
60 0           $args->{'comments'} = $comments;
61             }
62              
63 0 0         if (exists $args->{'lastEditors'}) {
64 0           my $editors = [];
65 0           foreach my $id (keys %{$args->{'lastEditors'}}) {
  0            
66 0           push @$editors, WebService::Wikimapia::User->new($args->{'lastEditors'}->{$id});
67             }
68 0           $args->{'lastEditors'} = $editors;
69             }
70              
71 0 0         if (exists $args->{'related'}) {
72 0           my $places = [];
73 0           foreach my $id (keys %{$args->{'related'}}) {
  0            
74 0           push @$places, WebService::Wikimapia::Place->new($args->{'related'}->{$id});
75             }
76 0           $args->{'related'} = $places;
77             }
78              
79 0 0         if (exists $args->{'nearestPlaces'}) {
80 0           my $places = [];
81 0           foreach my $id (keys %{$args->{'nearestPlaces'}}) {
  0            
82 0           push @$places, WebService::Wikimapia::Place->new($args->{'nearestPlaces'}->{$id});
83             }
84 0           $args->{'nearestPlaces'} = $places;
85             }
86              
87 0 0         if (exists $args->{'nearestComments'}) {
88 0           my $comments = [];
89 0           foreach my $comment (@{$args->{'nearestComments'}}) {
  0            
90 0           push @$comments, WebService::Wikimapia::Comment->new($comment);
91             }
92 0           $args->{'nearestComments'} = $comments;
93             }
94              
95 0 0         if (exists $args->{'nearestHotels'}) {
96 0           my $hotels = [];
97 0           foreach my $id (keys %{$args->{'nearestHotels'}}) {
  0            
98 0           push @$hotels, WebService::Wikimapia::Hotel->new($args->{'nearestHotels'}->{$id});
99             }
100 0           $args->{'nearestHotels'} = $hotels;
101             }
102              
103 0 0         if (exists $args->{'nearestCities'}) {
104 0           my $cities = [];
105 0           foreach my $id (keys %{$args->{'nearestCities'}}) {
  0            
106 0           push @$cities, WebService::Wikimapia::City->new($args->{'nearestCities'}->{$id});
107             }
108 0           $args->{'nearestCities'} = $cities;
109             }
110              
111 0 0         if (exists $args->{'nearestStreets'}) {
112 0           my $cities = [];
113 0           foreach my $id (keys %{$args->{'nearestStreets'}}) {
  0            
114 0           push @$cities, WebService::Wikimapia::City->new($args->{'nearestStreets'}->{$id});
115             }
116 0           $args->{'nearestStreets'} = $cities;
117             }
118              
119 0 0         if (exists $args->{'availableLanguages'}) {
120 0           my $languages = [];
121 0           foreach my $id (keys %{$args->{'availableLanguages'}}) {
  0            
122 0           push @$languages, WebService::Wikimapia::Language->new($args->{'availableLanguages'}->{$id});
123             }
124 0           $args->{'availableLanguages'} = $languages;
125             }
126              
127 0 0         if (exists $args->{'photos'}) {
128 0           my $photos = [];
129 0           foreach my $photo (@{$args->{'photos'}}) {
  0            
130 0           push @$photos, WebService::Wikimapia::Photo->new($photo);
131             }
132 0           $args->{'photos'} = $photos;
133             }
134              
135 0           return $args;
136             }
137              
138             =head1 METHODS
139              
140             =head2 id()
141              
142             Returns the id of the street.
143              
144             =head2 title()
145              
146             Returns the title of the street.
147              
148             =head2 photos()
149              
150             Returns the reference to the list of objects of type L.
151              
152             =head2 language_id()
153              
154             Returns the language id.
155              
156             =head2 language_iso()
157              
158             Returns the language iso.
159              
160             =head2 urlhtml()
161              
162             Returns the URL.
163              
164             =head2 object_type()
165              
166             Returns the object type.
167              
168             =head2 location()
169              
170             Returns an object of type L.
171              
172             =head2 comments()
173              
174             Returns the reference to the list of comments.
175              
176             =head2 lastEditors()
177              
178             =head2 related()
179              
180             =head2 nearestPlaces()
181              
182             Returns the reference to the list of objects of type L.
183              
184             =head2 nearestComments()
185              
186             Returns the reference to the list of objects of type L.
187              
188             =head2 nearestHotels()
189              
190             Returns the reference to the list of objects of type L.
191              
192             =head2 nearestCities()
193              
194             Returns the reference to the list of objects of type L.
195              
196             =head2 nearestStreets()
197              
198             Returns the reference to the list of objects of type L.
199              
200             =head2 availableLanguages()
201              
202             Returns the reference to the list of objects of type L.
203              
204             =head1 AUTHOR
205              
206             Mohammad S Anwar, C<< >>
207              
208             =head1 REPOSITORY
209              
210             L
211              
212             =head1 BUGS
213              
214             Please report any bugs or feature requests to C
215             rt.cpan.org>, or through the web interface at L.
216             I will be notified and then you'll automatically be notified of progress on your
217             bug as I make changes.
218              
219             =head1 SUPPORT
220              
221             You can find documentation for this module with the perldoc command.
222              
223             perldoc WebService::Wikimapia::Street
224              
225             You can also look for information at:
226              
227             =over 4
228              
229             =item * RT: CPAN's request tracker
230              
231             L
232              
233             =item * AnnoCPAN: Annotated CPAN documentation
234              
235             L
236              
237             =item * CPAN Ratings
238              
239             L
240              
241             =item * Search CPAN
242              
243             L
244              
245             =back
246              
247             =head1 LICENSE AND COPYRIGHT
248              
249             Copyright (C) 2011 - 2015 Mohammad S Anwar.
250              
251             This program is free software; you can redistribute it and/or modify it under
252             the terms of the the Artistic License (2.0). You may obtain a copy of the full
253             license at:
254              
255             L
256              
257             Any use, modification, and distribution of the Standard or Modified Versions is
258             governed by this Artistic License.By using, modifying or distributing the Package,
259             you accept this license. Do not use, modify, or distribute the Package, if you do
260             not accept this license.
261              
262             If your Modified Version has been derived from a Modified Version made by someone
263             other than you,you are nevertheless required to ensure that your Modified Version
264             complies with the requirements of this license.
265              
266             This license does not grant you the right to use any trademark, service mark,
267             tradename, or logo of the Copyright Holder.
268              
269             This license includes the non-exclusive, worldwide, free-of-charge patent license
270             to make, have made, use, offer to sell, sell, import and otherwise transfer the
271             Package with respect to any patent claims licensable by the Copyright Holder that
272             are necessarily infringed by the Package. If you institute patent litigation
273             (including a cross-claim or counterclaim) against any party alleging that the
274             Package constitutes direct or contributory patent infringement,then this Artistic
275             License to you shall terminate on the date that such litigation is filed.
276              
277             Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND
278             CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED
279             WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
280             NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL LAW. UNLESS
281             REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT,
282             INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE
283             OF THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
284              
285             =cut
286              
287             1; # End of WebService::Wikimapia::Street