File Coverage

blib/lib/GeoIP2/Record/MaxMind.pm
Criterion Covered Total %
statement 15 15 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod n/a
total 20 20 100.0


line stmt bran cond sub pod time code
1             package GeoIP2::Record::MaxMind;
2              
3 12     12   73 use strict;
  12         22  
  12         298  
4 12     12   54 use warnings;
  12         20  
  12         403  
5              
6             our $VERSION = '2.006002';
7              
8 12     12   56 use Moo;
  12         20  
  12         55  
9              
10 12     12   3293 use GeoIP2::Types qw( NonNegativeInt );
  12         22  
  12         640  
11              
12 12     12   98 use namespace::clean -except => 'meta';
  12         25  
  12         69  
13              
14             has queries_remaining => (
15             is => 'ro',
16             isa => NonNegativeInt,
17             );
18              
19             1;
20              
21             # ABSTRACT: Contains data for the maxmind record returned from a web service query
22              
23             __END__
24              
25             =pod
26              
27             =encoding UTF-8
28              
29             =head1 NAME
30              
31             GeoIP2::Record::MaxMind - Contains data for the maxmind record returned from a web service query
32              
33             =head1 VERSION
34              
35             version 2.006002
36              
37             =head1 SYNOPSIS
38              
39             use 5.008;
40              
41             use GeoIP2::WebService::Client;
42              
43             my $client = GeoIP2::WebService::Client->new(
44             account_id => 42,
45             license_key => 'abcdef123456',
46             );
47              
48             my $insights = $client->insights( ip => '24.24.24.24' );
49              
50             my $maxmind_rec = $insights->maxmind();
51             print $maxmind_rec->queries_remaining(), "\n";
52              
53             =head1 DESCRIPTION
54              
55             This class contains the maxmind record data returned from a web service query.
56              
57             Unlike other record classes, the data in this record is associated with your
58             MaxMind account, not with an IP address.
59              
60             This record is returned by all the end points.
61              
62             =head1 METHODS
63              
64             This class provides the following methods:
65              
66             =head2 $maxmind_rec->queries_remaining()
67              
68             The number of queries remaining for the end point you just queried. Note that
69             this is an approximation as query counts are only periodically synced across
70             all of MaxMind's servers.
71              
72             =head1 SUPPORT
73              
74             Bugs may be submitted through L<https://github.com/maxmind/GeoIP2-perl/issues>.
75              
76             =head1 AUTHORS
77              
78             =over 4
79              
80             =item *
81              
82             Dave Rolsky <drolsky@maxmind.com>
83              
84             =item *
85              
86             Greg Oschwald <goschwald@maxmind.com>
87              
88             =item *
89              
90             Mark Fowler <mfowler@maxmind.com>
91              
92             =item *
93              
94             Olaf Alders <oalders@maxmind.com>
95              
96             =back
97              
98             =head1 COPYRIGHT AND LICENSE
99              
100             This software is copyright (c) 2013 - 2019 by MaxMind, Inc.
101              
102             This is free software; you can redistribute it and/or modify it under
103             the same terms as the Perl 5 programming language system itself.
104              
105             =cut