Class: IpLocationSeeker

Inherits:
Object
  • Object
show all
Defined in:
lib/ipwry.rb

Instance Method Summary collapse

Instance Method Details

#seek(ip) ⇒ Object

查询IP


19
20
21
22
23
24
25
26
27
# File 'lib/ipwry.rb', line 19

def seek(ip) #查询IP
  unless File.exist? $fqqwry
    return ''
  end

  db = QQWry::Database.new $fqqwry
  r = db.query(ip)
  "#{r.country} #{r.area}"
end