End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
IPAddr#zone_id=
zone_id=(zid)
lib/ipaddr.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.1.3/lib/ipaddr.rb, line 479
def zone_id=(zid)
if @family == Socket::AF_INET6
case zid
when nil, /\A%(\w+)\z/
@zone_id = zid
else
raise InvalidAddressError, "invalid zone identifier for address"
end
else
raise InvalidAddressError, "not an IPv6 address"
end
end
Returns the IPv6 zone identifier, if present. Raises InvalidAddressError if not an IPv6 address.