Class: MaxMindDB::Result::NamedLocation

Inherits:
Object
  • Object
show all
Defined in:
lib/maxminddb/result/named_location.rb

Instance Method Summary collapse

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

#codeObject



8
9
10
# File 'lib/maxminddb/result/named_location.rb', line 8

def code
  raw['code']
end

#geoname_idObject



12
13
14
# File 'lib/maxminddb/result/named_location.rb', line 12

def geoname_id
  raw['geoname_id']
end

#is_in_european_unionObject



16
17
18
# File 'lib/maxminddb/result/named_location.rb', line 16

def is_in_european_union
  raw['is_in_european_union']
end

#iso_codeObject



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