NAME

Geo::Location::IP::Record::RepresentedCountry - Country details with a "type" field

VERSION

version 0.002

SYNOPSIS

use Geo::Location::IP::Database::Reader;
my $reader = Geo::Location::IP::Database::Reader->new(
  file => '/path/to/City.mmdb',
);
eval {
  my $city_model = $reader->city(ip => '1.2.3.4');
  my $country    = $city_model->represented_country;
};

DESCRIPTION

A Geo::Location::IP::Record::Country subclass that adds a type field.

This class contains details about the country represented by the users of an IP address. For example, the country represented by an overseas military base.

All fields may be undefined.

SUBROUTINES/METHODS

new

my $country = Geo::Location::IP::Record::RepresentedCountry->new(
  names => {
    de => 'USA',
    en => 'United States',
  },
  confidence           => 0,
  geoname_id           => 6252001,
  is_in_european_union => 0,
  iso_code             => 'US',
  type                 => 'military',
  locales              => ['de', 'en'],
);

Creates a new country record with a type field.

type

my $type = $country->type;

Returns a type such as "military".

DIAGNOSTICS

None.

CONFIGURATION AND ENVIRONMENT

None.

DEPENDENCIES

None.

INCOMPATIBILITIES

None.

BUGS AND LIMITATIONS

None known.

AUTHOR

Andreas Vögele <voegelas@cpan.org>

LICENSE AND COPYRIGHT

Copyright (C) 2025 Andreas Vögele

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.