Skip to content

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?

ipv4?

Returns true if the ipaddr is an IPv4 address.

See also #ip6_int #_ipv4_compat? #ip6_arpa #ipv4_compat also in 4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.0