Skip to content

Instantly share code, notes, and snippets.

@salzig
Created April 9, 2014 15:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save salzig/10280571 to your computer and use it in GitHub Desktop.
Save salzig/10280571 to your computer and use it in GitHub Desktop.
Monkey Patch Ruby's stdlib IPAddr with netmask method
require 'ipaddr'
class IPAddr
# netmask to the people!
def netmask
_to_string(@mask_addr)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment