struct

IP::Block::IPv6

Inherits IP::Block < Comparable < Struct < Value < Object

Constructors

loopback

Constructs a IP::Block:IPv6 representing the IPv6 loopback block.

Source
new(address : IP::Address::IPv6, block : Int) : self

Constructs a new IP::Block::IPv6 from an address and the block size, [0-128].

Raises: MalformedError when the input is malformed.

Source
new(string : String) : self

Constructs a new IP::Block::IPv6 by interpreting the contents of a given String.

Expects a definition in CIDR notation similar to XXXX:XXXX::XXXX:XXXX:XXXX/[0-128], or XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX/[0-128].

Raises: MalformedError when the input is malformed.

Source

Class methods

new?(address : IP::Address::IPv6, block : Int) : self | Nil

Constructs a new IP::Block::IPv6 from an address and the block size, [0-128].

Returns nil when the input is malformed.

Source
new?(string : String) : self | Nil

Constructs a new IP::Block::IPv6 by interpreting the contents of a given String.

Expects a definition in CIDR notation similar to XXXX:XXXX::XXXX:XXXX:XXXX/[0-128], or XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX/[0-128].

Returns nil when the input is malformed.

Source

Instance methods

address

Returns the address component of the block which is also the first address.

Source
block

Returns 'block' size in the form of 2^x, x being the 'size'.

Source
ipv6?

Informs if the block is IPv6 or not.

Source
size

Returns the size of the block in terms of number of addresses.

Source