module Smartgeoip

Constants

URL
VERSION

Public Class Methods

locate(ip, lang='en') click to toggle source
# File lib/smartgeoip.rb, line 8
def self.locate(ip, lang='en')
      uri = URI.parse(URL)
      uri.query = URI.encode_www_form :host => ip, :lang => lang
      ActiveSupport::JSON.decode(Net::HTTP.get(uri))
end