End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
IPAddr#ipv4_compat
ipv4_compat
lib/ipaddr.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.1.3/lib/ipaddr.rb, line 329
def ipv4_compat
warn "IPAddr\##{__callee__} is obsolete", uplevel: 1 if $VERBOSE
if !ipv4?
raise InvalidAddressError, "not an IPv4 address: #{@addr}"
end
return self.clone.set(@addr, Socket::AF_INET6)
end
Returns a new ipaddr built by converting the native IPv4 address into an IPv4-compatible IPv6 address.