| 1 | package GeoIP2::Model::ISP; | ||
| 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( IPAddress NonNegativeInt Str ); |
|
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 autonomous_system_number => ( | |
| 17 | is => 'ro', | ||
| 18 | isa => NonNegativeInt, | ||
| 19 | predicate => 'has_autonomous_system_number', | ||
| 20 | ); | ||
| 21 | |||
| 22 | 7 | has autonomous_system_organization => ( | |
| 23 | is => 'ro', | ||
| 24 | isa => Str, | ||
| 25 | predicate => 'has_autonomous_system_organization', | ||
| 26 | ); | ||
| 27 | |||
| 28 | 7 | has isp => ( | |
| 29 | is => 'ro', | ||
| 30 | isa => Str, | ||
| 31 | predicate => 'has_isp', | ||
| 32 | ); | ||
| 33 | |||
| 34 | 7 | has organization => ( | |
| 35 | is => 'ro', | ||
| 36 | isa => Str, | ||
| 37 | predicate => 'has_organization', | ||
| 38 | ); | ||
| 39 | |||
| 40 | 7 | 1; | |
| 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 | |||
| 52 | GeoIP2::Model::ISP - Model class for the GeoIP2 ISP database | ||
| 53 | |||
| 54 | =head1 VERSION | ||
| 55 | |||
| 56 | version 2.006000 | ||
| 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 | |||
| 81 | This class provides a model for the data returned by the GeoIP2 ISP database. | ||
| 82 | |||
| 83 | =head1 METHODS | ||
| 84 | |||
| 85 | This class provides the following methods: | ||
| 86 | |||
| 87 | =head2 $isp->autonomous_system_number() | ||
| 88 | |||
| 89 | This returns the autonomous system number | ||
| 90 | (L<http://en.wikipedia.org/wiki/Autonomous_system_(Internet)>) associated with | ||
| 91 | the IP address. | ||
| 92 | |||
| 93 | =head2 $isp->autonomous_system_organization() | ||
| 94 | |||
| 95 | This returns the organization associated with the registered autonomous system | ||
| 96 | number (L<http://en.wikipedia.org/wiki/Autonomous_system_(Internet)>) for the IP | ||
| 97 | address. | ||
| 98 | |||
| 99 | =head2 $isp->ip_address() | ||
| 100 | |||
| 101 | Returns the IP address used in the lookup. | ||
| 102 | |||
| 103 | =head2 $isp->isp() | ||
| 104 | |||
| 105 | This returns the name of the ISP associated with the IP address. | ||
| 106 | |||
| 107 | =head2 $isp->organization() | ||
| 108 | |||
| 109 | This returns the name of the organization associated with the IP address. | ||
| 110 | |||
| 111 | =head1 SUPPORT | ||
| 112 | |||
| 113 | =head1 AUTHORS | ||
| 114 | |||
| 115 | =over 4 | ||
| 116 | |||
| 117 | =item * | ||
| 118 | |||
| 119 | Dave Rolsky <drolsky@maxmind.com> | ||
| 120 | |||
| 121 | =item * | ||
| 122 | |||
| 123 | Greg Oschwald <goschwald@maxmind.com> | ||
| 124 | |||
| 125 | =item * | ||
| 126 | |||
| 127 | Mark Fowler <mfowler@maxmind.com> | ||
| 128 | |||
| 129 | =item * | ||
| 130 | |||
| 131 | Olaf Alders <oalders@maxmind.com> | ||
| 132 | |||
| 133 | =back | ||
| 134 | |||
| 135 | =head1 COPYRIGHT AND LICENSE | ||
| 136 | |||
| 137 | This software is copyright (c) 2013 - 2018 by MaxMind, Inc. | ||
| 138 | |||
| 139 | This is free software; you can redistribute it and/or modify it under | ||
| 140 | the same terms as the Perl 5 programming language system itself. | ||
| 141 | |||
| 142 | =cut | ||