Skip to content

Commit

Permalink
Merge pull request #18 from stiig/patch-1
Browse files Browse the repository at this point in the history
Add ability to pass params into open-uri function
  • Loading branch information
mokevnin committed Mar 28, 2017
2 parents 575ca6a + bec863f commit 2e4c619
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/ipgeobase.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ module Ipgeobase
URL = 'http://ipgeobase.ru:7020/geo'
autoload 'IpMetaData', 'ipgeobase/ip_meta_data'

def self.lookup(ip)
def self.lookup(ip, params = {})
uri = URI.parse(URL)
uri.query = URI.encode_www_form :ip => ip
resp = open(uri).read()
resp = open(uri, params).read()
IpMetaData.parse(resp.to_s)
end
end

0 comments on commit 2e4c619

Please sign in to comment.