Guest User

Untitled

a guest
Jul 22nd, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. def self.geocode(zip)
  2. response = get("/MapsService/V1/geocode", :query => {:zip => zip})
  3. if response['ResultSet']['Result'][0] || response['ResultSet']['Result']['Country'] != 'US'
  4. return nil
  5. else
  6. return [ response['ResultSet']['Result']['City'], response['ResultSet']['Result']['State'] ]
  7. end
  8. end
Add Comment
Please, Sign In to add comment