class MaxMind::GeoIP2::Model::Country

Model class for the data returned by the GeoIP2 Country web service and database. It is also used for GeoLite2 Country lookups.

Attributes

continent[R]

Continent data for the IP address.

@return [MaxMind::GeoIP2::Record::Continent]

country[R]

Country data for the IP address. This object represents the country where MaxMind believes the end user is located.

@return [MaxMind::GeoIP2::Record::Country]

maxmind[R]

Data related to your MaxMind account.

@return [MaxMind::GeoIP2::Record::MaxMind]

registered_country[R]

Registered country data for the IP address. This record represents the country where the ISP has registered a given IP block and may differ from the user's country.

@return [MaxMind::GeoIP2::Record::Country]

represented_country[R]

Represented country data for the IP address. The represented country is used for things like military bases. It is only present when the represented country differs from the country.

@return [MaxMind::GeoIP2::Record::RepresentedCountry]

traits[R]

Data for the traits of the IP address.

@return [MaxMind::GeoIP2::Record::Traits]

Public Class Methods

new(record, locales) click to toggle source

@!visibility private

# File lib/maxmind/geoip2/model/country.rb, line 71
def initialize(record, locales)
  @continent           = MaxMind::GeoIP2::Record::Continent.new(
    record['continent'],
    locales,
  )
  @country             = MaxMind::GeoIP2::Record::Country.new(
    record['country'],
    locales,
  )
  @maxmind             = MaxMind::GeoIP2::Record::MaxMind.new(record['maxmind'])
  @registered_country  = MaxMind::GeoIP2::Record::Country.new(
    record['registered_country'],
    locales,
  )
  @represented_country = MaxMind::GeoIP2::Record::RepresentedCountry.new(
    record['represented_country'],
    locales,
  )
  @traits              = MaxMind::GeoIP2::Record::Traits.new(record['traits'])
end