IPAddress::IPv4
Inherits Comparable < Enumerable < IPAddress < Reference < Object
Class IPAddress::IPv4 is used to handle IPv4 type addresses.
Class methods
Instance methods
each
Iterates over all the IP addresses for the given network (or IP address).
The object yielded is a new IPv4 object created
from the iteration.
ip = IPAddress.new "10.0.0.1/29"
ip.each do |i|
p i.address
end
# => "10.0.0.0"
# => "10.0.0.1"
# => "10.0.0.2"
# => "10.0.0.3"
# => "10.0.0.4"
# => "10.0.0.5"
# => "10.0.0.6"
# => "10.0.0.7"
includes?(other : IPv6)
Sourceincludes?(ip_address : Socket::IPAddress)
Sourceincludes?(*others : IPv6)
Source