3 # A class representing a syntactically valid domain. Essentially, the

4 # part after the "@" in an email address. Once constructed, you can be

5 # sure that it's valid.

6 #

7 class Domain

9 # @domain contains the String representation of this domain.

13 # Initialize this Domain object. If the domain is invalid, then an

14 # {InvalidDomainError} will be raised containing the reason

15 # why the domain is invalid.

16 #

17 # @param domain [String] the string representation of this domain.

18 #

23 end

26 end

29 # Convert this domain to a String.

30 #

31 # @return [String] the string representation of this Domain.

32 #

35 end

38 # Check if this Domain is equal to some other Domain. The comparison

39 # is based on their String representations.

40 #

41 # @param other [Domain] the Domain object to compare me to.

42 #

43 # @return [Boolean] If *self* and *other* have equal String

44 # representations, then true is returned. Otherwise, false is

45 # returned.

46 #

49 end

52 # Compare two Domain objects for sorting purposes. The comparison

53 # is based on their String representations.

54 #

55 # @param other [Domain] the Domain object to compare me to.

56 #

57 # @return [0,1,-1] a trinary indicator of how *self* relates to *other*,

58 # obtained by performing the same comparison on the String

59 # representations of *self* and *other*.

60 #

63 end

64 end