aboutsummaryrefslogtreecommitdiff
path: root/devel/rubygem-equatable/pkg-descr
blob: 0e8d0409fa68981e80163acecc94ed2f5359990e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
Equatable allows ruby objects to implement equality comparison and inspection
methods.

By including this module, a class indicates that its instances have explicit
general contracts for hash, == and eql? methods. Specifically eql? contract
requires that it implements an equivalence relation. By default each instance of
the class is equal only to itself. This is a right behaviour when you have
distinct objects. Howerver, it is the responsibility of any class to clearly
define their equality. Failure to do so may prevent instances to behave as
expected when for instance Array#uniq is invoked or when they are used as Hash
keys.

WWW: https://github.com/piotrmurach/equatable