File Coverage

blib/lib/WG/API.pm
Criterion Covered Total %
statement 21 21 100.0
branch n/a
condition n/a
subroutine 7 7 100.0
pod 5 5 100.0
total 33 33 100.0


line stmt bran cond sub pod time code
1             package WG::API;
2              
3 6     6   157542 use Modern::Perl '2015';
  6         41  
  6         29  
4 6     6   3755 use Moo;
  6         86426  
  6         24  
5              
6             =encoding utf8
7              
8             =head1 NAME
9              
10             WG::API - Module for work with Wargaming.net Public API
11              
12             =head1 VERSION
13              
14             Version v0.12
15              
16             =cut
17              
18             our $VERSION = 'v0.12';
19              
20             =head1 SYNOPSIS
21              
22             Wargaming.net Public API is a set of API methods that provide access to Wargaming.net content, including in-game and game-related content, as well as player statistics.
23              
24             This module provide access to WG Public API
25              
26             use WG::API;
27              
28             my $wg = WG::API->new( application_id => 'demo' );
29             ...
30             my $player = $wg->net( language => 'en' )->account_info( account_id => '1' );
31              
32             =head1 ATTRIBUTES
33              
34             =over 1
35              
36             =item I<application_id*>
37              
38             Rerquired application id: L<https://developers.wargaming.net/documentation/guide/getting-started/>
39              
40             =back
41              
42             =cut
43              
44             has application_id => (
45             is => 'ro',
46             require => 1,
47             );
48              
49             =head1 METHODS
50              
51             =over 1
52              
53             =item B<wot>
54              
55             Returns a WoT instance
56              
57             =back
58              
59             =cut
60              
61             #@returns WG::API::WoT
62             sub wot {
63 2     2 1 3983 my $self = shift;
64              
65 2         884 require WG::API::WoT;
66              
67 2         20 return WG::API::WoT->new(
68             application_id => $self->application_id,
69             @_,
70             );
71             }
72              
73             =over 1
74              
75             =item B<wowp>
76              
77             Returns a WoWp instance
78              
79             =back
80              
81             =cut
82              
83             #@returns WG::API::WoWp
84             sub wowp {
85 2     2 1 1677 my $self = shift;
86              
87 2         813 require WG::API::WoWp;
88              
89 2         19 return WG::API::WoWp->new(
90             application_id => $self->application_id,
91             @_,
92             );
93             }
94              
95             =over 1
96              
97             =item B<wows>
98              
99             Returns a WoWs instance
100              
101             =back
102              
103             =cut
104              
105             #@returns WG::API::WoWs
106             sub wows {
107 2     2 1 1586 my $self = shift;
108              
109 2         770 require WG::API::WoWs;
110              
111 2         21 return WG::API::WoWs->new(
112             application_id => $self->application_id,
113             @_,
114             );
115             }
116              
117             =over 1
118              
119             =item B<net>
120              
121             Returns a NET instance
122              
123             =back
124              
125             =cut
126              
127             #@returns WG::API::NET
128             sub net {
129 3     3 1 3989 my $self = shift;
130              
131 3         764 require WG::API::NET;
132              
133 3         45 return WG::API::NET->new(
134             application_id => $self->application_id,
135             @_,
136             );
137             }
138              
139             =over 1
140              
141             =item B<auth>
142              
143             Return a Auth instance
144              
145             =back
146              
147             =cut
148              
149             #@returns WG::API::Auth
150             sub auth {
151 2     2 1 2262 my $self = shift;
152              
153 2         13412 require WG::API::Auth;
154              
155 2         20 return WG::API::Auth->new(
156             application_id => $self->application_id,
157             @_,
158             );
159             }
160              
161             =head1 BUGS
162              
163             Please report any bugs or feature requests to C<cynovg at cpan.org>, or through the web interface at L<https://gitlab.com/cynovg/WG-API/issues>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
164              
165             =head1 SUPPORT
166              
167             You can find documentation for this module with the perldoc command.
168              
169             perldoc WG::API
170              
171             You can also look for information at:
172              
173             =over 4
174              
175             =item * RT: GitHub's request tracker (report bugs here)
176              
177             L<https://github.com/cynovg/p5-WG-API/issues>
178              
179             =item * AnnoCPAN: Annotated CPAN documentation
180              
181             L<http://annocpan.org/dist/WG-API>
182              
183             =item * CPAN Ratings
184              
185             L<http://cpanratings.perl.org/d/WG-API>
186              
187             =item * Search CPAN
188              
189             L<https://metacpan.org/pod/WG::API>
190              
191             =back
192              
193              
194             =head1 ACKNOWLEDGEMENTS
195              
196             ...
197              
198             =head1 SEE ALSO
199              
200             WG API Reference L<https://developers.wargaming.net/>
201              
202             =head1 AUTHOR
203              
204             Cyrill Novgorodcev , C<< <cynovg at cpan.org> >>
205              
206             =head1 LICENSE AND COPYRIGHT
207              
208             Copyright 2015 Cyrill Novgorodcev.
209              
210             This program is free software; you can redistribute it and/or modify it
211             under the terms of the the Artistic License (2.0). You may obtain a
212             copy of the full license at:
213              
214             L<http://www.perlfoundation.org/artistic_license_2_0>
215              
216             Any use, modification, and distribution of the Standard or Modified
217             Versions is governed by this Artistic License. By using, modifying or
218             distributing the Package, you accept this license. Do not use, modify,
219             or distribute the Package, if you do not accept this license.
220              
221             If your Modified Version has been derived from a Modified Version made
222             by someone other than you, you are nevertheless required to ensure that
223             your Modified Version complies with the requirements of this license.
224              
225             This license does not grant you the right to use any trademark, service
226             mark, tradename, or logo of the Copyright Holder.
227              
228             This license includes the non-exclusive, worldwide, free-of-charge
229             patent license to make, have made, use, offer to sell, sell, import and
230             otherwise transfer the Package with respect to any patent claims
231             licensable by the Copyright Holder that are necessarily infringed by the
232             Package. If you institute patent litigation (including a cross-claim or
233             counterclaim) against any party alleging that the Package constitutes
234             direct or contributory patent infringement, then this Artistic License
235             to you shall terminate on the date that such litigation is filed.
236              
237             Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER
238             AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
239             THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
240             PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY
241             YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR
242             CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR
243             CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE,
244             EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
245              
246              
247             =cut
248              
249             1; # End of WG::API