Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
IPAddr#ipv6?
() -> bool
ipv6?
lib/ipaddr.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/lib/ipaddr.rb, line 288
def ipv6?
return @family == Socket::AF_INET6
end
Returns true if the ipaddr is an IPv6 address.
See also
#ipv4_mapped?
#link_local?
#ipv4_mapped
#link_local_multicast?
also in
4.0 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0