Add ident equality

#569
This commit is contained in:
Artur Beljajev 2017-09-29 00:37:59 +03:00
parent 8a04fa793d
commit 1ae00382cd
2 changed files with 30 additions and 0 deletions

View file

@ -55,6 +55,16 @@ class Contact::Ident
Country.new(country_code)
end
def ==(other_ident)
if other_ident.is_a?(self.class)
(code == other_ident.code) &&
(type == other_ident.type) &&
(country_code == other_ident.country_code)
else
false
end
end
private
# https://github.com/rails/rails/issues/1513