1package GeoIP2::Model::ISP; 2 3use strict; 4use warnings; 5 6our $VERSION = '2.006002'; 7 8use Moo; 9 10use GeoIP2::Types qw( IPAddress NonNegativeInt Str ); 11 12use namespace::clean -except => 'meta'; 13 14with 'GeoIP2::Role::Model::Flat', 'GeoIP2::Role::HasIPAddress'; 15 16has autonomous_system_number => ( 17 is => 'ro', 18 isa => NonNegativeInt, 19 predicate => 'has_autonomous_system_number', 20); 21 22has autonomous_system_organization => ( 23 is => 'ro', 24 isa => Str, 25 predicate => 'has_autonomous_system_organization', 26); 27 28has isp => ( 29 is => 'ro', 30 isa => Str, 31 predicate => 'has_isp', 32); 33 34has organization => ( 35 is => 'ro', 36 isa => Str, 37 predicate => 'has_organization', 38); 39 401; 41 42# ABSTRACT: Model class for the GeoIP2 ISP database 43 44__END__ 45 46=pod 47 48=encoding UTF-8 49 50=head1 NAME 51 52GeoIP2::Model::ISP - Model class for the GeoIP2 ISP database 53 54=head1 VERSION 55 56version 2.006002 57 58=head1 SYNOPSIS 59 60 use 5.008; 61 62 use GeoIP2::Model::ISP; 63 64 my $isp = GeoIP2::Model::ISP->new( 65 raw => { 66 autonomous_system_number => '217', 67 autonomous_system_organization => 'University of Minnesota', 68 isp => 'University of Minnesota', 69 organization => 'University of Minnesota', 70 ip_address => '128.101.101.101', 71 } 72 ); 73 74 print $isp->autonomous_system_number(), "\n"; 75 print $isp->autonomous_system_organization(), "\n"; 76 print $isp->isp(), "\n"; 77 print $isp->organization(), "\n"; 78 79=head1 DESCRIPTION 80 81This class provides a model for the data returned by the GeoIP2 ISP database. 82 83=head1 METHODS 84 85This class provides the following methods: 86 87=head2 $isp->autonomous_system_number() 88 89This returns the autonomous system number 90(L<http://en.wikipedia.org/wiki/Autonomous_system_(Internet)>) associated with 91the IP address. 92 93=head2 $isp->autonomous_system_organization() 94 95This returns the organization associated with the registered autonomous system 96number (L<http://en.wikipedia.org/wiki/Autonomous_system_(Internet)>) for the IP 97address. 98 99=head2 $isp->ip_address() 100 101Returns the IP address used in the lookup. 102 103=head2 $isp->isp() 104 105This returns the name of the ISP associated with the IP address. 106 107=head2 $isp->organization() 108 109This returns the name of the organization associated with the IP address. 110 111=head1 SUPPORT 112 113Bugs may be submitted through L<https://github.com/maxmind/GeoIP2-perl/issues>. 114 115=head1 AUTHORS 116 117=over 4 118 119=item * 120 121Dave Rolsky <drolsky@maxmind.com> 122 123=item * 124 125Greg Oschwald <goschwald@maxmind.com> 126 127=item * 128 129Mark Fowler <mfowler@maxmind.com> 130 131=item * 132 133Olaf Alders <oalders@maxmind.com> 134 135=back 136 137=head1 COPYRIGHT AND LICENSE 138 139This software is copyright (c) 2013 - 2019 by MaxMind, Inc. 140 141This is free software; you can redistribute it and/or modify it under 142the same terms as the Perl 5 programming language system itself. 143 144=cut 145