My version of equalizer gem
Download gem file from this repo and run
gem build equalizer.gem_spec
gem install ./[gem_name]
require 'equalizer'
class Point
extend Equalizer
equalize(:x, :y)
def initialize(x, y)
@x = x
@y = y
end
end
zero = Point.new(0, 0)
zero == Point.new(0, 0) # => true
zero == Point.new(1, 0) # => false
zero.eql? Point.new(0, 0) # => true
zero.eql? Point.new(1, 0) # => false
zero.equal? Point.new(0, 0) # => false
zero.equal? Point.new(1, 0) # => false
{ zero => 0 }[Point.new(0, 0)] # => 0- Fork it ( https://github.com/mhib/equalizer/fork )
- 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 a new Pull Request

