Sha256: ef885d8cb6686642f9c25df8b56cbc7c0b46e5ffdbab9e70fd4176992d717ae4

Contents?: true

Size: 286 Bytes

Versions: 1

Compression:

Stored size: 286 Bytes

Contents

require 'uri'
require 'net/http'

module Ipgeobase
  URL = 'http://ipgeobase.ru:7020/geo'
  autoload 'IpMetaData', 'ipgeobase/ip_meta_data'

  def self.lookup(ip)
    uri = URI.parse(URL)
    uri.query = URI.encode_www_form :ip => ip

    IpMetaData.parse(Net::HTTP.get(uri))
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ipgeobase-0.1.0 lib/ipgeobase.rb