method
_to_string
v1_9_3_392 -
Show latest stable
- Class:
IPAddr
_to_string(addr)private
No documentation available.
# File lib/ipaddr.rb, line 580
def _to_string(addr)
case @family
when Socket::AF_INET
return (0..3).map { |i|
(addr >> (24 - 8 * i)) & 0xff
}.join('.')
when Socket::AF_INET6
return (("%.32x" % addr).gsub!(/.{4}(?!$)/, '\&:'))
else
raise "unsupported address family"
end
end