| 1 | package GeoIP2::Record::Postal; | ||
| 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.006000'; | |
| 7 | |||
| 8 | 12 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | |||
| 10 | 12 | ▶ | use GeoIP2::Types qw( NonNegativeInt Str ); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | |||
| 12 | 12 | ▶ | use namespace::clean -except => 'meta'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 13 | |||
| 14 | 12 | has code => ( | |
| 15 | is => 'ro', | ||
| 16 | isa => Str, | ||
| 17 | predicate => 'has_code', | ||
| 18 | ); | ||
| 19 | |||
| 20 | 12 | has confidence => ( | |
| 21 | is => 'ro', | ||
| 22 | isa => NonNegativeInt, | ||
| 23 | predicate => 'has_confidence', | ||
| 24 | ); | ||
| 25 | |||
| 26 | 12 | 1; | |
| 27 | |||
| 28 | # ABSTRACT: Contains data for the postal code record associated with an IP address | ||
| 29 | |||
| 30 | __END__ | ||
| 31 | |||
| 32 | =pod | ||
| 33 | |||
| 34 | =encoding UTF-8 | ||
| 35 | |||
| 36 | =head1 NAME | ||
| 37 | |||
| 38 | GeoIP2::Record::Postal - Contains data for the postal code record associated with an IP address | ||
| 39 | |||
| 40 | =head1 VERSION | ||
| 41 | |||
| 42 | version 2.006000 | ||
| 43 | |||
| 44 | =head1 SYNOPSIS | ||
| 45 | |||
| 46 | use 5.008; | ||
| 47 | |||
| 48 | use GeoIP2::WebService::Client; | ||
| 49 | |||
| 50 | my $client = GeoIP2::WebService::Client->new( | ||
| 51 | account_id => 42, | ||
| 52 | license_key => 'abcdef123456', | ||
| 53 | ); | ||
| 54 | |||
| 55 | my $insights = $client->insights( ip => '24.24.24.24' ); | ||
| 56 | |||
| 57 | my $postal_rec = $insights->postal(); | ||
| 58 | print $postal_rec->code(), "\n"; | ||
| 59 | |||
| 60 | =head1 DESCRIPTION | ||
| 61 | |||
| 62 | This class contains the postal code data associated with an IP address. | ||
| 63 | |||
| 64 | This record is returned by all the end points except the Country end point. | ||
| 65 | |||
| 66 | =head1 METHODS | ||
| 67 | |||
| 68 | This class provides the following methods: | ||
| 69 | |||
| 70 | =head2 $postal_rec->code() | ||
| 71 | |||
| 72 | This returns the postal code associated with the IP address. Postal codes are | ||
| 73 | not available for all countries. In some countries, this will only contain | ||
| 74 | part of the postal code. | ||
| 75 | |||
| 76 | This attribute is returned by all end points except the Country end point. | ||
| 77 | |||
| 78 | =head2 $postal_rec->confidence() | ||
| 79 | |||
| 80 | This returns a value from 0-100 indicating MaxMind's confidence that the | ||
| 81 | postal code is correct. | ||
| 82 | |||
| 83 | This attribute is only available from the Insights end point and the GeoIP2 | ||
| 84 | Enterprise database. | ||
| 85 | |||
| 86 | =head1 SUPPORT | ||
| 87 | |||
| 88 | =head1 AUTHORS | ||
| 89 | |||
| 90 | =over 4 | ||
| 91 | |||
| 92 | =item * | ||
| 93 | |||
| 94 | Dave Rolsky <drolsky@maxmind.com> | ||
| 95 | |||
| 96 | =item * | ||
| 97 | |||
| 98 | Greg Oschwald <goschwald@maxmind.com> | ||
| 99 | |||
| 100 | =item * | ||
| 101 | |||
| 102 | Mark Fowler <mfowler@maxmind.com> | ||
| 103 | |||
| 104 | =item * | ||
| 105 | |||
| 106 | Olaf Alders <oalders@maxmind.com> | ||
| 107 | |||
| 108 | =back | ||
| 109 | |||
| 110 | =head1 COPYRIGHT AND LICENSE | ||
| 111 | |||
| 112 | This software is copyright (c) 2013 - 2018 by MaxMind, Inc. | ||
| 113 | |||
| 114 | This is free software; you can redistribute it and/or modify it under | ||
| 115 | the same terms as the Perl 5 programming language system itself. | ||
| 116 | |||
| 117 | =cut | ||