Class: Graticule::Geocoder::HostIp
- Defined in:
- lib/graticule/geocoder/host_ip.rb
Constant Summary
Constants inherited from Base
Instance Method Summary collapse
-
#initialize ⇒ HostIp
constructor
A new instance of HostIp.
-
#locate(address) ⇒ Object
Geocode an IP address using hostip.info.
Constructor Details
#initialize ⇒ HostIp
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 |