lib/geokit/services/ip.rb in geokit-1.7.0.rc1 vs lib/geokit/services/ip.rb in geokit-1.7.0
- old
+ new
@@ -55,10 +55,10 @@
body = body.encode('UTF-8') if body.respond_to? :encode
yaml = YAML.load(body)
res = GeoLoc.new
res.provider = 'hostip'
res.city, res.state = yaml['City'].split(', ')
- country, res.country_code = yaml['Country'].split(' (')
+ res.country, res.country_code = yaml['Country'].split(' (')
res.lat = yaml['Latitude']
res.lng = yaml['Longitude']
res.country_code.chop!
res.success = !(res.city =~ /\(.+\)/)
res