ipaddr
ipaddr copied to clipboard
Add IPAddr#+/-
Add +/- methods to get an ipaddr instance greater/less than the original address by offset.
the current IPAddr#succ
only return next address, this IPAddr#+
return any address with offset.
addr = IPAddr.new("192.168.1.10")
addr + 10
=> #<IPAddr: IPv4:192.168.1.20/255.255.255.255>
(addr + 10).to_s
=> "192.168.1.20"