I'm trying to check if my IP is a loopback ip, I get this:
ip = IPAddress('127.0.0.1').loopback?
NoMethodError: undefined method `loopback?' for 127.0.0.1:IPAddress::IPv4
from /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/railties-3.2.8/lib/rails/commands/console.rb:47:in `start'
from /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/railties-3.2.8/lib/rails/commands/console.rb:8:in `start'
from /usr/local/Cellar/ruby/1.9.3-p194/lib/ruby/gems/1.9.1/gems/railties-3.2.8/lib/rails/commands.rb:41:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
It is not implemented. The IPv6 equivalent doesn't seem completely valid either :
My current workaround is to check if a given IP address is included in 127.0.0.0/8 (I only need v4 currently). Would be a nice addition to the gem's feature set!
It'd be easy enough to include this in a PR but when is 1.0 coming out. I would imagine most are hesitant to contribute changes that would get clobbered by a major release.
This was fixed by Mike in f562a7f7