Skip to content

Commit

Permalink
Fix equality.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnunemaker committed Jun 22, 2011
1 parent 4a70d9b commit 343f524
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/user_agent.rb
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ def inspect
"#<UserAgent:#{name} version:#{version.inspect} engine:\"#{engine.to_s}:#{engine_version}\" os:#{os.to_s.inspect}>"
end

def ==(other)
source == other.source
def eql?(other)
self.class.eql?(other.class) && source == other.source
end
alias :== :eql?
end

0 comments on commit 343f524

Please sign in to comment.