Module: CaTissue::HashCode

Included in:
Annotation, CollectionProtocol, CollectionProtocolEvent, StorageType
Defined in:
lib/catissue/helpers/hash_code.rb

Overview

This HashCode mix-in overrides the caTissue hashCode and equality test to work around caTissue bugs.

Instance Method Summary collapse

Instance Method Details

#==(other) ⇒ Boolean

Returns whether the objects are identical.

Parameters:

  • other

    the object to compare

Returns:

  • (Boolean)

    whether the objects are identical

See Also:



17
18
19
# File 'lib/catissue/helpers/hash_code.rb', line 17

def ==(other)
  equal?(other)
end

#hashInteger

Returns a unique hash code.

Returns:

  • (Integer)

    a unique hash code

See Also:



9
10
11
# File 'lib/catissue/helpers/hash_code.rb', line 9

def hash
  proxy_object_id * 31 + 17
end