struct

Exu::Domain::DomainName

Inherits Struct < Value < Object

Value object representing an RFC 1035/1123 compliant domain name.

Constants

DOMAIN_REGEX = /^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+$/

Regex conforming strictly to RFC 1035/1123: Labels 1..63 chars, alphanumeric or hyphen (not starting or ending with hyphen) Total length at most 253 characters

Constructors

new(raw : String)
Source

Class methods

valid?(raw : String) : Bool

Validates if raw string complies with RFC 1035/1123 domain syntax

Source

Instance methods

==(other : DomainName) : Bool
Source
==(other : String) : Bool
Source
hash(hasher)

See Object#hash(hasher)

Source
to_s(io : IO) : Nil

Same as #inspect(io).

Source
to_s

Returns a nicely readable and concise string representation of this object, typically intended for users.

This method should usually not be overridden. It delegates to #to_s(IO) which can be overridden for custom implementations.

Also see #inspect.

Source
value
Source