class MaxMindDB::Result

Attributes

raw[R]

Public Class Methods

new(raw) click to toggle source
# File lib/maxminddb/result.rb, line 9
def initialize(raw)
  @raw = raw || {}
end

Public Instance Methods

[](attr) click to toggle source
# File lib/maxminddb/result.rb, line 13
def [](attr)
  raw[attr]
end
city() click to toggle source
# File lib/maxminddb/result.rb, line 17
def city
  @_city ||= NamedLocation.new(raw['city'])
end
connection_type() click to toggle source
# File lib/maxminddb/result.rb, line 57
def connection_type
  @_connection_type ||= raw['connection_type']
end
continent() click to toggle source
# File lib/maxminddb/result.rb, line 21
def continent
  @_continent ||= NamedLocation.new(raw['continent'])
end
country() click to toggle source
# File lib/maxminddb/result.rb, line 25
def country
  @_country ||= NamedLocation.new(raw['country'])
end
found?() click to toggle source
# File lib/maxminddb/result.rb, line 29
def found?
  !raw.empty?
end
location() click to toggle source
# File lib/maxminddb/result.rb, line 33
def location
  @_location ||= Location.new(raw['location'])
end
network() click to toggle source
# File lib/maxminddb/result.rb, line 61
def network
  @_network ||= raw['network']
end
postal() click to toggle source
# File lib/maxminddb/result.rb, line 37
def postal
  @_postal ||= Postal.new(raw['postal'])
end
registered_country() click to toggle source
# File lib/maxminddb/result.rb, line 41
def registered_country
  @_registered_country ||= NamedLocation.new(raw['registered_country'])
end
represented_country() click to toggle source
# File lib/maxminddb/result.rb, line 45
def represented_country
  @_represented_country ||= NamedLocation.new(raw['represented_country'])
end
subdivisions() click to toggle source
# File lib/maxminddb/result.rb, line 49
def subdivisions
  @_subdivisions ||= Subdivisions.new(raw['subdivisions'])
end
to_hash() click to toggle source
# File lib/maxminddb/result.rb, line 65
def to_hash
  @_to_hash ||= raw.clone
end
traits() click to toggle source
# File lib/maxminddb/result.rb, line 53
def traits
  @_traits ||= Traits.new(raw['traits'])
end