Permalink
Browse files

Whois::Answer#== refactoring.

  • Loading branch information...
1 parent 333829a commit 585b48be88cae858e5d47afbfc564a69f62e1b60 @semaperepelitsa semaperepelitsa committed Feb 7, 2011
Showing with 7 additions and 8 deletions.
  1. +7 −8 lib/whois/answer.rb
View
@@ -71,16 +71,15 @@ def inspect
# @return [Boolean]
def ==(other)
if equal?(other)
- return true
- end
- if other.is_a?(self.class)
- return to_s == other.to_s
- end
- if other.is_a?(String)
+ true
+ elsif other.is_a?(self.class)
+ to_s == other.to_s
+ elsif other.is_a?(String)
Whois.deprecate "Comparing an answer with a String is deprecated and will be removed in Whois 2.1."
- return to_s == other.to_s
+ to_s == other.to_s
+ else
+ false
end
- false
end
alias_method :eql?, :==

0 comments on commit 585b48b

Please sign in to comment.