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