IP::Address
Inherits Comparable < Comparable < Struct < Value < Object
Constructors
Constructs a new IPv4 or IPv6 IP::Address by interpreting the contents of a String.
Expects an address in the form of [0-255].[0-255].[0-255].[0-255], XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX, or XXXX:XXXX::XXXX:XXXX:XXXX.
Raises: MalformedError when the input is malformed.
Creates an IP::Address from the internal OS representation of a Socket Address.
Class methods
Constructs a new IPv4 or IPv6 IP::Address by interpreting the contents of a String.
Expects an address in the form of [0-255].[0-255].[0-255].[0-255], XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX, or XXXX:XXXX::XXXX:XXXX:XXXX.
Returns nil when the input is malformed.
Constructs a new IPv4 IP::Address from the contents of a String.
Expects an address in the form of [0-255].[0-255].[0-255].[0-255].
Raises: MalformedError when the input is malformed.
Constructs a new IPv4 IP::Address from the contents of a String.
Expects an address in the form of [0-255].[0-255].[0-255].[0-255].
Returns nil when the input is malformed.
Constructs a new IPv6 IP::Address from the contents of a String.
Expects an address in the standard presentation form XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX or in the compressed from similar to XXXX:XXXX::XXXX:XXXX:XXXX.
Raises: MalformedError when the input is malformed.
Constructs a new IPv6 IP::Address from the contents of a String.
Expects an address in the standard presentation form XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX:XXXX or in the compressed from similar to XXXX:XXXX::XXXX:XXXX:XXXX.
Returns nil when the input is malformed.
Instance methods
Compares this address with another, returning -1, 0 or +1 depending if the
address is less, equal or greater than the other address.
Compares this address with block, returning -1, 0 or +1 depending if the
address is less than, included in, or greater than the other block.
Compares this address with another address, indicating if they are adjacent.
Adjacency is when there are no addresses between the address and the other address and the two addresses are not the same.
Compares this address with an IP::Block, indicating if they are adjacent.
Adjacency is when there are no addresses between the address and the other address block and the address is not included in the block.
Appends a type-specified presentation representation of the address to the
given IO.