| 1 | package GeoIP2::Record::Traits; | ||
| 2 | |||
| 3 | 12 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 12 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 12 | our $VERSION = '2.006002'; | |
| 7 | |||
| 8 | 12 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | |||
| 10 | 12 | ▶ | use GeoIP2::Types qw( Bool BoolCoercion IPAddress NonNegativeInt Str ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | 12 | ▶ | use Sub::Quote qw( quote_sub ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | |||
| 13 | 12 | ▶ | use namespace::clean -except => 'meta'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 14 | |||
| 15 | 12 | with 'GeoIP2::Role::HasIPAddress'; | |
| 16 | |||
| 17 | 12 | has autonomous_system_number => ( | |
| 18 | is => 'ro', | ||
| 19 | isa => NonNegativeInt, | ||
| 20 | predicate => 'has_autonomous_system_number', | ||
| 21 | ); | ||
| 22 | |||
| 23 | 12 | has autonomous_system_organization => ( | |
| 24 | is => 'ro', | ||
| 25 | isa => Str, | ||
| 26 | predicate => 'has_autonomous_system_organization', | ||
| 27 | ); | ||
| 28 | |||
| 29 | 12 | has connection_type => ( | |
| 30 | is => 'ro', | ||
| 31 | isa => Str, | ||
| 32 | predicate => 'has_connection_type', | ||
| 33 | ); | ||
| 34 | |||
| 35 | 12 | has domain => ( | |
| 36 | is => 'ro', | ||
| 37 | isa => Str, | ||
| 38 | predicate => 'has_domain', | ||
| 39 | ); | ||
| 40 | |||
| 41 | 12 | has [ | |
| 42 | 'is_anonymous', | ||
| 43 | 'is_anonymous_proxy', | ||
| 44 | 'is_anonymous_vpn', | ||
| 45 | 'is_hosting_provider', | ||
| 46 | 'is_legitimate_proxy', | ||
| 47 | 'is_public_proxy', | ||
| 48 | 'is_satellite_provider', | ||
| 49 | 'is_tor_exit_node', | ||
| 50 | ] => ( | ||
| 51 | is => 'ro', | ||
| 52 | isa => Bool, | ||
| 53 | default => quote_sub(q{ 0 }), | ||
| 54 | coerce => BoolCoercion, | ||
| 55 | ); | ||
| 56 | |||
| 57 | 12 | has isp => ( | |
| 58 | is => 'ro', | ||
| 59 | isa => Str, | ||
| 60 | predicate => 'has_isp', | ||
| 61 | ); | ||
| 62 | |||
| 63 | 12 | has organization => ( | |
| 64 | is => 'ro', | ||
| 65 | isa => Str, | ||
| 66 | predicate => 'has_organization', | ||
| 67 | ); | ||
| 68 | |||
| 69 | 12 | has user_type => ( | |
| 70 | is => 'ro', | ||
| 71 | isa => Str, | ||
| 72 | predicate => 'has_user_type', | ||
| 73 | ); | ||
| 74 | |||
| 75 | 12 | 1; | |
| 76 | |||
| 77 | # ABSTRACT: Contains data for the traits record associated with an IP address | ||
| 78 | |||
| 79 | __END__ | ||