File Coverage

blib/lib/WebService/Wikimapia/Object.pm
Criterion Covered Total %
statement 20 36 55.5
branch 0 6 0.0
condition n/a
subroutine 7 8 87.5
pod 0 1 0.0
total 27 51 52.9


line stmt bran cond sub pod time code
1             package WebService::Wikimapia::Object;
2              
3             $WebService::Wikimapia::Object::VERSION = '0.14';
4             $WebService::Wikimapia::Object::AUTHORITY = 'cpan:MANWAR';
5              
6             =head1 NAME
7              
8             WebService::Wikimapia::Object - Placeholder for 'object' of search result of L.
9              
10             =head1 VERSION
11              
12             Version 0.14
13              
14             =cut
15              
16 7     7   136 use 5.006;
  7         22  
17 7     7   34 use Data::Dumper;
  7         13  
  7         383  
18 7     7   42 use WebService::Wikimapia::Tag;
  7         13  
  7         207  
19 7     7   68 use WebService::Wikimapia::Polygon;
  7         16  
  7         158  
20 7     7   38 use WebService::Wikimapia::Location;
  7         16  
  7         139  
21              
22 7     7   31 use Moo;
  7         13  
  7         34  
23 7     7   2074 use namespace::autoclean;
  7         13  
  7         56  
24              
25             has 'id' => (is => 'ro');
26             has 'title' => (is => 'ro');
27             has 'description' => (is => 'ro');
28             has 'x' => (is => 'ro');
29             has 'y' => (is => 'ro');
30             has 'h' => (is => 'ro');
31             has 'polygon_x' => (is => 'ro');
32             has 'polygon_y' => (is => 'ro');
33             has 'city_id' => (is => 'ro');
34             has 'country_adm_id'=> (is => 'ro');
35             has 'house_no' => (is => 'ro');
36             has 'pl' => (is => 'ro');
37             has 'zoom' => (is => 'ro');
38             has 'yc' => (is => 'ro');
39             has 'wikipedia' => (is => 'ro');
40             has 'urlForTemplate'=> (is => 'ro');
41             has 'polygon' => (is => 'ro');
42             has 'tags' => (is => 'ro');
43             has 'location' => (is => 'ro');
44              
45             sub BUILDARGS {
46 0     0 0   my ($class, $args) = @_;
47              
48 0 0         if (exists $args->{'tags'}) {
49 0           my $tags = [];
50 0           foreach my $tag (@{$args->{'tags'}}) {
  0            
51 0           push @$tags, WebService::Wikimapia::Tag->new($tag);
52             }
53 0           $args->{'tags'} = $tags;
54             }
55              
56 0 0         if (exists $args->{'polygon'}) {
57 0           my $polygons = [];
58 0           foreach my $polygon (@{$args->{'polygon'}}) {
  0            
59 0           push @$polygons, WebService::Wikimapia::Polygon->new($polygon);
60             }
61 0           $args->{'polygon'} = $polygons;
62             }
63              
64 0 0         if (exists $args->{'location'}) {
65 0           $args->{'location'} = WebService::Wikimapia::Location->new($args->{'location'});
66             }
67              
68 0           return $args;
69             }
70              
71             =head1 METHODS
72              
73             =head2 id()
74              
75             =head2 title()
76              
77             =head2 description()
78              
79             =head2 x()
80              
81             =head2 y()
82              
83             =head2 h()
84              
85             =head2 polygon_x()
86              
87             =head2 polygon_y()
88              
89             =head2 city_id()
90              
91             =head2 country_adm_id()
92              
93             =head2 house_no()
94              
95             =head2 pl()
96              
97             =head2 zoom()
98              
99             =head2 yc()
100              
101             =head2 wikipedia()
102              
103             =head2 urlForTemplate()
104              
105             =head2 polygon()
106              
107             =head2 tags()
108              
109             =head2 location()
110              
111             =head1 AUTHOR
112              
113             Mohammad S Anwar, C<< >>
114              
115             =head1 REPOSITORY
116              
117             L
118              
119             =head1 BUGS
120              
121             Please report any bugs or feature requests to C
122             rt.cpan.org>, or through the web interface at L.
123             I will be notified and then you'll automatically be notified of progress on your
124             bug as I make changes.
125              
126             =head1 SUPPORT
127              
128             You can find documentation for this module with the perldoc command.
129              
130             perldoc WebService::Wikimapia::Object
131              
132             You can also look for information at:
133              
134             =over 4
135              
136             =item * RT: CPAN's request tracker
137              
138             L
139              
140             =item * AnnoCPAN: Annotated CPAN documentation
141              
142             L
143              
144             =item * CPAN Ratings
145              
146             L
147              
148             =item * Search CPAN
149              
150             L
151              
152             =back
153              
154             =head1 LICENSE AND COPYRIGHT
155              
156             Copyright (C) 2011 - 2015 Mohammad S Anwar.
157              
158             This program is free software; you can redistribute it and/or modify it under
159             the terms of the the Artistic License (2.0). You may obtain a copy of the full
160             license at:
161              
162             L
163              
164             Any use, modification, and distribution of the Standard or Modified Versions is
165             governed by this Artistic License.By using, modifying or distributing the Package,
166             you accept this license. Do not use, modify, or distribute the Package, if you do
167             not accept this license.
168              
169             If your Modified Version has been derived from a Modified Version made by someone
170             other than you,you are nevertheless required to ensure that your Modified Version
171             complies with the requirements of this license.
172              
173             This license does not grant you the right to use any trademark, service mark,
174             tradename, or logo of the Copyright Holder.
175              
176             This license includes the non-exclusive, worldwide, free-of-charge patent license
177             to make, have made, use, offer to sell, sell, import and otherwise transfer the
178             Package with respect to any patent claims licensable by the Copyright Holder that
179             are necessarily infringed by the Package. If you institute patent litigation
180             (including a cross-claim or counterclaim) against any party alleging that the
181             Package constitutes direct or contributory patent infringement,then this Artistic
182             License to you shall terminate on the date that such litigation is filed.
183              
184             Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND
185             CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED
186             WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR
187             NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL LAW. UNLESS
188             REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT,
189             INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE
190             OF THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
191              
192             =cut
193              
194             1; # End of WebService::Wikimapia::Object