class IPGeo::Result
Constants
- EU_COUNTRY_CODES
Public Class Methods
new(hash)
click to toggle source
# File lib/ip_geo/result.rb, line 8 def initialize(hash) @hash = hash end
Public Instance Methods
city()
click to toggle source
# File lib/ip_geo/result.rb, line 20 def city @hash['city'] end
country()
click to toggle source
# File lib/ip_geo/result.rb, line 12 def country @hash['country'] end
country_name()
click to toggle source
# File lib/ip_geo/result.rb, line 16 def country_name @hash['country_name'] end
eu?()
click to toggle source
# File lib/ip_geo/result.rb, line 36 def eu? EU_COUNTRY_CODES.include?(country) end
geoname_id()
click to toggle source
# File lib/ip_geo/result.rb, line 32 def geoname_id @hash['geoname_id'] end
latitude()
click to toggle source
# File lib/ip_geo/result.rb, line 24 def latitude @hash['latitude'] end
longitude()
click to toggle source
# File lib/ip_geo/result.rb, line 28 def longitude @hash['longitude'] end