simple-identity
simple-identity is a Ruby library for providing simple identity methods of #eql?, #==, and #hash.
Installation
$ gem install simple-identity
Usage
class A
include SimpleIdentity
attr_accessor :a, :b, :c
def initialize(a, b, c)
@a = a
@b = b
@c = c
end
end
A.new(1,2,3) == A.new(1,2,3) # true
A.new(1,2,3) != A.new(3,2,1) # true
License
simple-identity is free software distributed under MIT license.
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request