Class: MaxMindDB::Result::Subdivisions

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

Instance Method Summary collapse

Constructor Details

#initialize(raw) ⇒ Subdivisions

Returns a new instance of Subdivisions.



4
5
6
# File 'lib/maxminddb/result/subdivisions.rb', line 4

def initialize(raw)
  super((raw || []).map { |hash| NamedLocation.new(hash) })
end

Instance Method Details

#inspectObject



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

def inspect
  "#<MaxMindDB::Result::Subdivisions: #{super}>"
end

#most_specificObject



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

def most_specific
  last || NamedLocation.new({})
end