GeoIP2/Model/ISP.pm

filter: Statementstmt 100% 19 / 19 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod n/a totaltotal 100% 23 / 23 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« GeoIP2/Model/Domain.pm ↑ Summary GeoIP2/Model/Insights.pm »
1 package GeoIP2::Model::ISP;
2 1 $GeoIP2::Model::ISP::VERSION = '0.050000';
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use GeoIP2::Types qw( IPAddress NonNegativeInt Str );
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 with 'GeoIP2::Role::Model::Flat', 'GeoIP2::Role::HasIPAddress';
11  
12 1 has autonomous_system_number => (
13 is => 'ro',
14 isa => NonNegativeInt,
15 predicate => 'has_autonomous_system_number',
16 );
17  
18 1 has autonomous_system_organization => (
19 is => 'ro',
20 isa => Str,
21 predicate => 'has_autonomous_system_organization',
22 );
23  
24 1 has isp => (
25 is => 'ro',
26 isa => Str,
27 predicate => 'has_isp',
28 );
29  
30 1 has organization => (
31 is => 'ro',
32 isa => Str,
33 predicate => 'has_organization',
34 );
35  
36 1 1;
37  
38 # ABSTRACT: Model class for the GeoIP2 ISP database
39  
40 __END__
41  
42 =pod
43  
44 =head1 NAME
45  
46 GeoIP2::Model::ISP - Model class for the GeoIP2 ISP database
47  
48 =head1 VERSION
49  
50 version 0.050000
51  
52 =head1 SYNOPSIS
53  
54 use 5.008;
55  
56 use GeoIP2::Model::ISP;
57  
58 my $record = GeoIP2::Model::ISP->new(
59 raw => {
60 autonomous_system_number => '217',
61 autonomous_system_organization => 'University of Minnesota',
62 isp => 'University of Minnesota',
63 organization => 'University of Minnesota',
64 ip_address => '128.101.101.101',
65 }
66 );
67  
68 say $record->autonomous_system_number();
69 say $record->autonomous_system_organization();
70 say $record->isp();
71 say $record->organization();
72  
73 =head1 DESCRIPTION
74  
75 This class provides a model for GeoIP2 Connection-Type.
76  
77 =head1 METHODS
78  
79 This class provides the following methods:
80  
81 =head2 $record->autonomous_system_number()
82  
83 This returns the autonomous system number
84 (L<http://en.wikipedia.org/wiki/Autonomous_system_(Internet)>) associated with
85 the IP address.
86  
87 =head2 $record->autonomous_system_organization()
88  
89 This returns the organization associated with the registered autonomous system
90 number (L<http://en.wikipedia.org/wiki/Autonomous_system_(Internet)>) for the IP
91 address.
92  
93 =head2 $record->ip_address()
94  
95 Returns the IP address used in the lookup.
96  
97 =head2 $record->isp()
98  
99 This returns the name of the ISP associated with the IP address.
100  
101 =head2 $record->organization()
102  
103 This returns the name of the organization associated with the IP address.
104  
105 =head1 AUTHORS
106  
107 =over 4
108  
109 =item *
110  
111 Dave Rolsky <drolsky@maxmind.com>
112  
113 =item *
114  
115 Greg Oschwald <goschwald@maxmind.com>
116  
117 =item *
118  
119 Olaf Alders <oalders@maxmind.com>
120  
121 =back
122  
123 =head1 COPYRIGHT AND LICENSE
124  
125 This software is copyright (c) 2014 by MaxMind, Inc..
126  
127 This is free software; you can redistribute it and/or modify it under
128 the same terms as the Perl 5 programming language system itself.
129  
130 =cut
« GeoIP2/Model/Domain.pm ↑ Summary GeoIP2/Model/Insights.pm »