lib/lita/user.rb in lita-4.3.2 vs lib/lita/user.rb in lita-4.4.0
- old
+ new
@@ -98,11 +98,11 @@
# @since 3.1.0
def mention_name
metadata["mention_name"] || name
end
- # Saves the user record to Redis, overwriting an previous data for the
+ # Saves the user record to Redis, overwriting any previous data for the
# current ID and user name.
# @return [void]
def save
mention_name = metadata[:mention_name] || metadata["mention_name"]
@@ -120,12 +120,14 @@
def ==(other)
other.respond_to?(:id) && id == other.id && other.respond_to?(:name) && name == other.name
end
alias_method :eql?, :==
+ # Generates a +Fixnum+ hash value for this user object. Implemented to support equality.
+ # @return [Fixnum] The hash value.
+ # @see Object#hash
def hash
- id.hash ^
- name.hash
+ id.hash ^ name.hash
end
private
# Ensure the user's metadata contains their name, to ensure their Redis hash contains at least