summaryrefslogtreecommitdiff
path: root/lib/ipaddr.rb
diff options
context:
space:
mode:
authorBogdan Irimie <bogdan.irimie@puppet.com>2019-10-09 13:23:27 +0300
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2021-10-07 18:22:43 +0900
commit74ed881e109ee2480854f5d47e8ef4a84b0cc1c5 (patch)
tree7f374a99f605a80f2d40410177c81bbf532c1862 /lib/ipaddr.rb
parentabad5e10e80c06f2e756667cd2d7f7d9b6e78ba5 (diff)
[ruby/ipaddr] Add netmask method that returns net mask as string.
https://github.com/ruby/ipaddr/commit/283d16f3a3
Diffstat (limited to 'lib/ipaddr.rb')
-rw-r--r--lib/ipaddr.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/ipaddr.rb b/lib/ipaddr.rb
index 6c0ded2a77..c21c0cbf12 100644
--- a/lib/ipaddr.rb
+++ b/lib/ipaddr.rb
@@ -466,6 +466,11 @@ class IPAddr
af, _to_string(@addr), _to_string(@mask_addr))
end
+ # Returns the netmask in string format e.g. 255.255.0.0
+ def netmask
+ _to_string(@mask_addr)
+ end
+
protected
# Set +@addr+, the internal stored ip address, to given +addr+. The