Class: GeoIP::ISP

Inherits:
Object
  • Object
show all
Includes:
Base, Tools
Defined in:
lib/ffi-geoip/isp.rb

Instance Method Summary collapse

Methods included from Base

included, #value_to_addr

Constructor Details

#initialize(*args) ⇒ ISP

Returns a new instance of ISP.



8
9
10
# File 'lib/ffi-geoip/isp.rb', line 8

def initialize(*args)
  initialize_geoip(*args)
end

Instance Method Details

#look_up(addr) ⇒ Object



12
13
14
15
16
17
# File 'lib/ffi-geoip/isp.rb', line 12

def look_up(addr)
  addr = value_to_addr(addr)
  check_type(addr, String)

  fix_encoding(:isp => FFIGeoIP.GeoIP_name_by_addr(@ptr, addr))
end