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.



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

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



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

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