class MaxMind::GeoIP2::Record::Subdivision

Contains data for the subdivisions associated with an IP address.

This record is returned by all location databases and services besides Country.

See {MaxMind::GeoIP2::Record::Place} for inherited methods.

Public Instance Methods

confidence() click to toggle source

This is a value from 0-100 indicating MaxMind's confidence that the subdivision is correct. This attribute is only available from the Insights service and the GeoIP2 Enterprise database.

@return [Integer, nil]

# File lib/maxmind/geoip2/record/subdivision.rb, line 40
def confidence
  get('confidence')
end
geoname_id() click to toggle source

This is a GeoName ID for the subdivision. This attribute is returned by all location databases and services besides Country.

@return [Integer, nil]

# File lib/maxmind/geoip2/record/subdivision.rb, line 48
def geoname_id
  get('geoname_id')
end
iso_code() click to toggle source

This is a string up to three characters long contain the subdivision portion of the ISO 3166-2 code. See en.wikipedia.org/wiki/ISO_3166-2. This attribute is returned by all location databases and services except Country.

@return [String, nil]

# File lib/maxmind/geoip2/record/subdivision.rb, line 58
def iso_code
  get('iso_code')
end
names() click to toggle source

A Hash where the keys are locale codes and the values are names. This attribute is returned by all location services and databases besides country.

@return [Hash<String, String>, nil]

# File lib/maxmind/geoip2/record/subdivision.rb, line 66
def names
  get('names')
end