5fb345bb2f779f642dbb7254f4d078fe1745d536
[mailshears.git] / lib / common / domain.rb
1 require 'common/errors'
2
3 class Domain
4
5 @domain = nil
6
7 def initialize(domain)
8 if domain.empty? then
9 msg = "domain cannot be empty"
10 raise InvalidDomainError.new(msg)
11 end
12
13 @domain = domain
14 end
15
16 def to_s()
17 return @domain
18 end
19
20 def ==(other)
21 return self.to_s() == other.to_s()
22 end
23 end