X-Git-Url: http://gitweb.michael.orlitzky.com/?p=mailshears.git;a=blobdiff_plain;f=lib%2Fcommon%2Fdomain.rb;fp=lib%2Fcommon%2Fdomain.rb;h=5fb345bb2f779f642dbb7254f4d078fe1745d536;hp=0000000000000000000000000000000000000000;hb=f819b178c5c1cb8adda0182c610e5c52fad8bea7;hpb=8a3e804a4c5f33bee1d80243be6b139e45f07a48 diff --git a/lib/common/domain.rb b/lib/common/domain.rb new file mode 100644 index 0000000..5fb345b --- /dev/null +++ b/lib/common/domain.rb @@ -0,0 +1,23 @@ +require 'common/errors' + +class Domain + + @domain = nil + + def initialize(domain) + if domain.empty? then + msg = "domain cannot be empty" + raise InvalidDomainError.new(msg) + end + + @domain = domain + end + + def to_s() + return @domain + end + + def ==(other) + return self.to_s() == other.to_s() + end +end