lib/lita/user.rb in lita-4.3.0 vs lib/lita/user.rb in lita-4.3.1
- old
+ new
@@ -118,9 +118,15 @@
# @param other (Lita::User) The user to compare against.
# @return [Boolean] True if users are equal, false otherwise.
def ==(other)
other.respond_to?(:id) && id == other.id && other.respond_to?(:name) && name == other.name
end
+ alias_method :eql?, :==
+
+ def hash
+ id.hash ^
+ name.hash
+ end
private
# Ensure the user's metadata contains their name, to ensure their Redis hash contains at least
# one value. It's not possible to store an empty hash key in Redis.