Class: Graticule::Geocoder::HostIp

Inherits:
Base
  • Object
show all
Defined in:
lib/graticule/geocoder/host_ip.rb

Constant Summary

Constants inherited from Base

Base::USER_AGENT

Instance Method Summary collapse

Constructor Details

#initializeHostIp

Returns a new instance of HostIp.



8
9
10
# File 'lib/graticule/geocoder/host_ip.rb', line 8

def initialize
  @url = URI.parse 'http://api.hostip.info/get_html.php'
end

Instance Method Details

#locate(address) ⇒ Object

Geocode an IP address using hostip.info



13
14
15
# File 'lib/graticule/geocoder/host_ip.rb', line 13

def locate(address)
  get :ip => address, :position => true
end