GeoIP2/Model/AnonymousIP.pm

filter: Statementstmt 100% 19 / 19 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 100% 24 / 24 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« GeoIP2/Model/ASN.pm ↑ Summary GeoIP2/Model/City.pm »
1 package GeoIP2::Model::AnonymousIP;
2  
3 7 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 7 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 7 our $VERSION = '2.006000';
7  
8 7 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 7 ▶use GeoIP2::Types qw( Bool );
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 7 ▶use namespace::clean -except => 'meta';
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 7 with 'GeoIP2::Role::Model::Flat', 'GeoIP2::Role::HasIPAddress';
15  
16 7 has [
17 'is_anonymous',
18 'is_anonymous_vpn',
19 'is_hosting_provider',
20 'is_public_proxy',
21 'is_tor_exit_node'
22 ] => (
23 is => 'ro',
24 isa => Bool,
25 default => 0,
26 );
27  
28 7 1;
29  
30 # ABSTRACT: Model class for the GeoIP2 Anonymous IP database
31  
32 __END__
33  
34 =pod
35  
36 =encoding UTF-8
37  
38 =head1 NAME
39  
40 GeoIP2::Model::AnonymousIP - Model class for the GeoIP2 Anonymous IP database
41  
42 =head1 VERSION
43  
44 version 2.006000
45  
46 =head1 SYNOPSIS
47  
48 use 5.008;
49  
50 use GeoIP2::Model::AnonymousIP;
51  
52 my $anon = GeoIP2::Model::AnonymousIP->new(
53 raw => {
54 is_anonymous => 1,
55 is_hosting_provider => 1,
56 ip_address => '24.24.24.24'
57 }
58 );
59  
60 print $anon->is_anonymous(), "\n";
61  
62 =head1 DESCRIPTION
63  
64 This class provides a model for the data returned by the GeoIP2 Anonymous IP
65 database.
66  
67 =head1 METHODS
68  
69 This class provides the following methods:
70  
71 =head2 $anon->is_anonymous()
72  
73 Returns true if the IP address belongs to any sort of anonymous network.
74  
75 =head2 $anon->is_anonymous_vpn()
76  
77 Returns true if the IP address belongs to an anonymous VPN system.
78  
79 =head2 $anon->is_hosting_provider()
80  
81 Returns true if the IP address belongs to a hosting provider.
82  
83 =head2 $anon->is_public_proxy()
84  
85 Returns true if the IP address belongs to a public proxy.
86  
87 =head2 $anon->is_tor_exit_node()
88  
89 Returns true if the IP address is a Tor exit node.
90  
91 =head2 $anon->ip_address()
92  
93 Returns the IP address used in the lookup.
94  
95 =head1 SUPPORT
96  
97 =head1 AUTHORS
98  
99 =over 4
100  
101 =item *
102  
103 Dave Rolsky <drolsky@maxmind.com>
104  
105 =item *
106  
107 Greg Oschwald <goschwald@maxmind.com>
108  
109 =item *
110  
111 Mark Fowler <mfowler@maxmind.com>
112  
113 =item *
114  
115 Olaf Alders <oalders@maxmind.com>
116  
117 =back
118  
119 =head1 COPYRIGHT AND LICENSE
120  
121 This software is copyright (c) 2013 - 2018 by MaxMind, Inc.
122  
123 This is free software; you can redistribute it and/or modify it under
124 the same terms as the Perl 5 programming language system itself.
125  
126 =cut
« GeoIP2/Model/ASN.pm ↑ Summary GeoIP2/Model/City.pm »