class IPAddress::IPv4

Overview

Class IPAddress::IPv4 is used to handle IPv4 type addresses.

Included Modules

Defined in:

lib/ipaddress/src/ipaddress/ipv4.cr
coffee/extra/ipaddress/ipv4.cr

Class Method Summary

Instance Method Summary

Class Method Detail

def self.parse_u32_address(u32, prefix = 32) : IPAddress #

[View source]

Instance Method Detail

def each(&) : Nil #

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"

[View source]
def includes?(other : IPv6) #

[View source]
def includes?(others : Array(IPv6)) #

[View source]
def includes?(*others : IPv6) #

[View source]