Class: MaxMind::GeoIP2::Record::Country
- Defined in:
- lib/maxmind/geoip2/record/country.rb
Overview
Contains data for the country record associated with an IP address.
This record is returned by all location services and databases.
See Place for inherited methods.
Direct Known Subclasses
Instance Method Summary collapse
-
#confidence ⇒ Integer?
A value from 0-100 indicating MaxMind’s confidence that the country is correct.
-
#geoname_id ⇒ Integer?
The GeoName ID for the country.
-
#in_european_union? ⇒ Boolean
This is true if the country is a member state of the European Union.
-
#iso_code ⇒ String?
The two-character ISO 3166-1 alpha code for the country.
-
#names ⇒ Hash<String, String>?
A Hash where the keys are locale codes and the values are names.
Methods inherited from Place
Instance Method Details
#confidence ⇒ Integer?
A value from 0-100 indicating MaxMind’s confidence that the country is correct. This attribute is only available from the Insights service and the GeoIP2 Enterprise database.
19 20 21 |
# File 'lib/maxmind/geoip2/record/country.rb', line 19 def confidence get('confidence') end |
#geoname_id ⇒ Integer?
The GeoName ID for the country. This attribute is returned by all location services and databases.
27 28 29 |
# File 'lib/maxmind/geoip2/record/country.rb', line 27 def geoname_id get('geoname_id') end |
#in_european_union? ⇒ Boolean
This is true if the country is a member state of the European Union. This attribute is returned by all location services and databases.
35 36 37 |
# File 'lib/maxmind/geoip2/record/country.rb', line 35 def in_european_union? get('is_in_european_union') end |
#iso_code ⇒ String?
The two-character ISO 3166-1 alpha code for the country. See en.wikipedia.org/wiki/ISO_3166-1. This attribute is returned by all location services and databases.
44 45 46 |
# File 'lib/maxmind/geoip2/record/country.rb', line 44 def iso_code get('iso_code') end |
#names ⇒ Hash<String, String>?
A Hash where the keys are locale codes and the values are names. This attribute is returned by all location services and databases.
52 53 54 |
# File 'lib/maxmind/geoip2/record/country.rb', line 52 def names get('names') end |