Class: MaxMindDB::Result::NamedLocation
- Inherits:
-
Object
- Object
- MaxMindDB::Result::NamedLocation
- Defined in:
- lib/maxminddb/result/named_location.rb
Instance Method Summary collapse
- #code ⇒ Object
- #geoname_id ⇒ Object
-
#initialize(raw) ⇒ NamedLocation
constructor
A new instance of NamedLocation.
- #is_in_european_union ⇒ Object
- #iso_code ⇒ Object
- #name(locale = :en) ⇒ Object
Constructor Details
#initialize(raw) ⇒ NamedLocation
Returns a new instance of NamedLocation.
4 5 6 |
# File 'lib/maxminddb/result/named_location.rb', line 4 def initialize(raw) @raw = raw || {} end |
Instance Method Details
#code ⇒ Object
8 9 10 |
# File 'lib/maxminddb/result/named_location.rb', line 8 def code raw['code'] end |
#geoname_id ⇒ Object
12 13 14 |
# File 'lib/maxminddb/result/named_location.rb', line 12 def geoname_id raw['geoname_id'] end |
#is_in_european_union ⇒ Object
16 17 18 |
# File 'lib/maxminddb/result/named_location.rb', line 16 def is_in_european_union raw['is_in_european_union'] end |
#iso_code ⇒ Object
20 21 22 |
# File 'lib/maxminddb/result/named_location.rb', line 20 def iso_code raw['iso_code'] end |
#name(locale = :en) ⇒ Object
24 25 26 |
# File 'lib/maxminddb/result/named_location.rb', line 24 def name(locale = :en) raw['names'] && raw['names'][locale.to_s] end |