instance method
IPAddr#inspect
() -> ::String
inspect
lib/ipaddr.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/ipaddr.rb, line 490
def inspect
case @family
when Socket::AF_INET
af = "IPv4"
when Socket::AF_INET6
af = "IPv6"
zone_id = @zone_id.to_s
else
raise AddressFamilyError, "unsupported address family"
end
return sprintf("#<%s: %s:%s%s/%s>", self.class.name,
af, _to_string(@addr), zone_id, _to_string(@mask_addr))
end
Returns a string containing a human-readable representation of the ipaddr. (“#<IPAddr: family:address/mask>”)