I don't see a way to retrieve a subnet in CIDR (net/prefix) format from
ipaddr.rb. I find that this format is more commonly used now than the
subnet mask presentation returned by inspect, and it's fiddly to convert
outside the module.
Could consideration be given to adding a method such as the following?
def cidr
sprintf("%s/%d", _to_string(@addr), sprintf("%b",@mask_addr).count("1"))
end
With thanks
Simon