Skip to content

Commit

Permalink
Updated new freegeoip json response.
Browse files Browse the repository at this point in the history
  • Loading branch information
soerentorp committed Sep 11, 2011
1 parent deca4a8 commit 2d06448
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions lib/geocoder/results/freegeoip.rb
Expand Up @@ -12,19 +12,19 @@ def city
end

def state
@data['region_name']
@data['regionname']
end

def state_code
@data['region_code']
@data['regioncode']
end

def country
@data['country_name']
@data['countryname']
end

def country_code
@data['country_code']
@data['countrycode']
end

def postal_code
Expand Down
20 changes: 10 additions & 10 deletions test/fixtures/freegeoip_74_200_247_59.json
@@ -1,12 +1,12 @@
{
"city": "Plano",
"region_code": "TX",
"region_name": "Texas",
"metrocode": "623",
"zipcode": "75093",
"longitude": "-96.8134",
"country_name": "United States",
"country_code": "US",
"ip": "74.200.247.59",
"latitude": "33.0347"
"status":true,
"ip":"74.200.247.59",
"countrycode":"US",
"countryname":"United States",
"regioncode":"TX",
"regionname":"Texas",
"city":"Plano",
"zipcode":"75093",
"latitude":33.0347,
"longitude":-96.8134
}

0 comments on commit 2d06448

Please sign in to comment.