diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-05-22 02:21:56 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-05-22 02:21:56 +0000 |
commit | 95e1fc5b4e3125e866ec855dec7c2d888706dd00 () | |
tree | eb9143956c5fb90b762210513a2e9ff3cb53aba2 /lib/ipaddr.rb | |
parent | bb34bcbe470d62b6dccac38ef0a1e8ee435b8530 (diff) |
* lib/ipaddr.rb: Improve documentation. by Sandor Szucs.
[Ruby 1.9 - Bug #4753] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31686 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | lib/ipaddr.rb | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -19,6 +19,7 @@ require 'socket' unless Socket.const_defined? "AF_INET6" class Socket < BasicSocket AF_INET6 = Object.new end @@ -51,6 +52,14 @@ unless Socket.const_defined? "AF_INET6" end alias getaddress_orig getaddress def getaddress(s) if valid?(s) s @@ -86,8 +95,11 @@ end class IPAddr IN4MASK = 0xffffffff IN6MASK = 0xffffffffffffffffffffffffffffffff IN6FORMAT = (["%.4x"] * 8).join(':') # Returns the address family of this IP address. @@ -377,6 +389,9 @@ class IPAddr protected def set(addr, *family) case family[0] ? family[0] : @family when Socket::AF_INET @@ -397,6 +412,7 @@ class IPAddr return self end def mask!(mask) if mask.kind_of?(String) if mask =~ /^\d+$/ |