Skip to content

Latest commit

 

History

History
21 lines (16 loc) · 433 Bytes

README.md

File metadata and controls

21 lines (16 loc) · 433 Bytes

Datacenter Lookup

Datacenter Lookup is an IP address parser in Ruby using the datacenters list from IPCat.

Installation:

gem 'datacenter_lookup', '~> 0.1.3'

Then, look up your IP address like so:

irb
require 'datacenter_lookup'
dc = DatacenterLookup::Parser.new()
ip = "5.79.26.0"
puts dc.find(ip) # => "http://www.rackspace.com/"
ip2 = "1.1.1.1"
puts dc.find(ip2) # => nil