title: Ruby IPAddr: find address mask
body: <p>I have an application where I process a lot of IP addresses (analysing Checkpoint firewall rule sets).  At one point I want to check if a particular address object is a /32 or a 'network'.</p>
  
  <p>Currently I am doing it like this:</p>
  
  <p><code>next unless ip.inspect.match(/\/255\.255\.255\.255/)</code></p>
  
  <p>it works but seems a bit inefficient but I can't see any method that extracts the mask from the address object.</p>