| 1 | package GeoIP2::Model::ASN; | ||
| 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 | 1; | |
| 29 | |||
| 30 | # ABSTRACT: Model class for the GeoLite2 ASN database | ||
| 31 | |||
| 32 | __END__ | ||
| 33 | |||
| 34 | =pod | ||
| 35 | |||
| 36 | =encoding UTF-8 | ||
| 37 | |||
| 38 | =head1 NAME | ||
| 39 | |||
| 40 | GeoIP2::Model::ASN - Model class for the GeoLite2 ASN database | ||
| 41 | |||
| 42 | =head1 VERSION | ||
| 43 | |||
| 44 | version 2.006000 | ||
| 45 | |||
| 46 | =head1 SYNOPSIS | ||
| 47 | |||
| 48 | use 5.008; | ||
| 49 | |||
| 50 | use GeoIP2::Model::ASN (); | ||
| 51 | |||
| 52 | my $asn = GeoIP2::Model::ASN->new( | ||
| 53 | raw => { | ||
| 54 | autonomous_system_number => '217', | ||
| 55 | autonomous_system_organization => 'University of Minnesota', | ||
| 56 | ip_address => '128.101.101.101', | ||
| 57 | } | ||
| 58 | ); | ||
| 59 | |||
| 60 | print $asn->autonomous_system_number(), "\n"; | ||
| 61 | print $asn->autonomous_system_organization(), "\n"; | ||
| 62 | |||
| 63 | =head1 DESCRIPTION | ||
| 64 | |||
| 65 | This class provides a model for the data returned by the GeoLite2 ASN database. | ||
| 66 | |||
| 67 | =head1 METHODS | ||
| 68 | |||
| 69 | This class provides the following methods: | ||
| 70 | |||
| 71 | =head2 $asn->autonomous_system_number() | ||
| 72 | |||
| 73 | This returns the autonomous system number | ||
| 74 | (L<http://en.wikipedia.org/wiki/Autonomous_system_(Internet)>) associated with | ||
| 75 | the IP address. | ||
| 76 | |||
| 77 | =head2 $asn->autonomous_system_organization() | ||
| 78 | |||
| 79 | This returns the organization associated with the registered autonomous system | ||
| 80 | number (L<http://en.wikipedia.org/wiki/Autonomous_system_(Internet)>) for the IP | ||
| 81 | address. | ||
| 82 | |||
| 83 | =head2 $asn->ip_address() | ||
| 84 | |||
| 85 | Returns the IP address used in the lookup. | ||
| 86 | |||
| 87 | =head1 SUPPORT | ||
| 88 | |||
| 89 | =head1 AUTHORS | ||
| 90 | |||
| 91 | =over 4 | ||
| 92 | |||
| 93 | =item * | ||
| 94 | |||
| 95 | Dave Rolsky <drolsky@maxmind.com> | ||
| 96 | |||
| 97 | =item * | ||
| 98 | |||
| 99 | Greg Oschwald <goschwald@maxmind.com> | ||
| 100 | |||
| 101 | =item * | ||
| 102 | |||
| 103 | Mark Fowler <mfowler@maxmind.com> | ||
| 104 | |||
| 105 | =item * | ||
| 106 | |||
| 107 | Olaf Alders <oalders@maxmind.com> | ||
| 108 | |||
| 109 | =back | ||
| 110 | |||
| 111 | =head1 COPYRIGHT AND LICENSE | ||
| 112 | |||
| 113 | This software is copyright (c) 2013 - 2018 by MaxMind, Inc. | ||
| 114 | |||
| 115 | This is free software; you can redistribute it and/or modify it under | ||
| 116 | the same terms as the Perl 5 programming language system itself. | ||
| 117 | |||
| 118 | =cut | ||