abstract struct IPAddress::Prefix

Overview

IPAddress::Prefix is the parent class for IPAddress::Prefix32 and IPAddress::Prefix128, defining some methods in common for both the subclasses.

Included Modules

Direct Known Subclasses

Defined in:

ipaddress/prefix.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(prefix : Int) #

Creates a new general prefix.


[View source]

Instance Method Detail

def +(other : Prefix) : Int #

Returns the sums of two prefixes.


[View source]
def +(other : Int) : Int #

Returns the sum of #prefix and an other.


[View source]
def -(other : Prefix) : Int #

Returns the difference between two prefixes.


[View source]
def -(other : Int) : Int #

Returns the difference between #prefix and an other.


[View source]
def <=>(other : Prefix) #

Compares the prefixes.


[View source]
def <=>(other : Int) #

Compares the prefixes.


[View source]
def hash(hasher) #

Returns the #prefix.


[View source]
def pred : Prefix #

Returns the predecessor to the #prefix.


[View source]
def prefix : Int32 #

Returns IP prefix value.


[View source]
def succ : Prefix #

Returns the successor to the #prefix.


[View source]
def to_i : Int32 #

Returns the #prefix.


[View source]
def to_s(io : IO) #

Appends a string representation of the prefix to the given IO object.


[View source]