Pattern: Use of object_id
for key
Issue: -
Prefer using Hash#compare_by_identity
than using object_id
for hash keys.
# bad
hash = {}
hash[foo.object_id] = :bar
hash.key?(baz.object_id)
# good
hash = {}.compare_by_identity
hash[foo] = :bar
hash.key?(baz)