Hostname
Inherits Reference < Object
Constructors
Constructs a new Hostname by interpreting the contents of a String.
Expects an hostname like "example.com" or "example.com.".
Raises: MalformedError when the input is malformed.
Constructs a new Hostname by interpreting the contents of an Array of Strings.
Expects input like: ["example", "com"].
Raises: MalformedError when the input is malformed.
Class methods
Constructs a new Hostname by interpreting the contents of a String.
Expects an hostname like "example.com" or "example.com.".
Returns: nil when the input is malformed.
Constructs a new Hostname by interpreting the contents of an Array of Strings.
Expects input like: ["example", "com"].
Returns: nil when the input is malformed.
Instance methods
Compares this hostname with another, returning -1, 0 or +1 depending if the
hostname is less, equal or greater than the other hostname.
This compares the top level alphabetically. If they match the next next level is tried.
Returns the first IP::Address resolved for the hostname.
Raises: nil if no address is found.
Returns the first IP::Address resolved for the hostname.
Returns: nil if no address is found.
Returns an Array of IP::Addresses that were resolved for the hostname.
Creates a new child hostname (subdomain).
Raises: MalformedError if the hostname is malformed.
Creates a new child hostname (subdomain).
Returns: nil if the hostname is malformed.
Yields the IP::Addresses that were resolved for the hostname.
Creates the parent hostname.
Raises: Enumerable::EmptyError if the hostname is a Top-Level-Domain.
Creates the parent hostname.
Returns: nil if the hostname is a Top-Level-Domain.
Yields the IP::Addresses, Socket::Types, and Socket:: Protocols that were resolved for the hostname.
Indicates if the reciever is a subdomain of the given hostname.
Appends the string representation of this hostname to the given IO with the option
of making the hostname fully qualified.
Returns the string representation of this hostname with the option of making the hostname fully qualified.