class Geocoder::Result::Ip2locationLite

Public Class Methods

response_attributes() click to toggle source
# File lib/geocoder/results/ip2location_lite.rb, line 34
def self.response_attributes
  %w[country_short country_long region latitude longitude isp
    domain netspeed areacode iddcode timezone zipcode weatherstationname
    weatherstationcode mcc mnc mobilebrand elevation usagetype addresstype
    category district asn as]
end

Public Instance Methods

city() click to toggle source
# File lib/geocoder/results/ip2location_lite.rb, line 10
def city
  @data[:city]
end
coordinates() click to toggle source
# File lib/geocoder/results/ip2location_lite.rb, line 6
def coordinates
  [@data[:latitude], @data[:longitude]]
end
country() click to toggle source
# File lib/geocoder/results/ip2location_lite.rb, line 22
def country
  @data[:country_long]
end
country_code() click to toggle source
# File lib/geocoder/results/ip2location_lite.rb, line 26
def country_code
  @data[:country_short]
end
postal_code() click to toggle source
# File lib/geocoder/results/ip2location_lite.rb, line 30
def postal_code
  @data[:zipcode]
end
state() click to toggle source
# File lib/geocoder/results/ip2location_lite.rb, line 14
def state
  @data[:region]
end
state_code() click to toggle source
# File lib/geocoder/results/ip2location_lite.rb, line 18
def state_code
  "" # Not available in Maxmind's database
end