method
set
set(addr, *family)
protected
Hide source
# File lib/ipaddr.rb, line 336 def set(addr, *family) case family[0] ? family[0] : @family when Socket::AF_INET if addr < 0 || addr > IN4MASK raise ArgumentError, "invalid address" end when Socket::AF_INET6 if addr < 0 || addr > IN6MASK raise ArgumentError, "invalid address" end else raise ArgumentError, "unsupported address family" end @addr = addr if family[0] @family = family[0] end return self end