Sha256: bfe8500f51eaeae3bc16cba3b52c705689c3c28787ae0908d0cc15837452119f
Contents?: true
Size: 1.76 KB
Versions: 2
Compression:
Stored size: 1.76 KB
Contents
equalizer ========= Module to define equality, equivalence and inspection methods [][gem] [][travis] [][gemnasium] [][codeclimate] [][coveralls] [gem]: https://rubygems.org/gems/equalizer [travis]: https://travis-ci.org/dkubb/equalizer [gemnasium]: https://gemnasium.com/dkubb/equalizer [codeclimate]: https://codeclimate.com/github/dkubb/equalizer [coveralls]: https://coveralls.io/r/dkubb/equalizer Examples -------- ``` ruby class GeoLocation include Equalizer.new(:latitude, :longitude) attr_reader :latitude, :longitude def initialize(latitude, longitude) @latitude, @longitude = latitude, longitude end end point_a = GeoLocation.new(1, 2) point_b = GeoLocation.new(1, 2) point_c = GeoLocation.new(2, 2) point_a.inspect # => "#<GeoLocation latitude=1 longitude=2>" point_a == point_b # => true point_a.hash == point_b.hash # => true point_a.eql?(point_b) # => true point_a.equal?(point_b) # => false point_a == point_c # => false point_a.hash == point_c.hash # => false point_a.eql?(point_c) # => false point_a.equal?(point_c) # => false ``` Credits ------- * Dan Kubb ([dkubb](https://github.com/dkubb)) * Piotr Solnica ([solnic](https://github.com/solnic)) * Markus Schirp ([mbj](https://github.com/mbj)) Contributing ------------- See [CONTRIBUTING.md](CONTRIBUTING.md) for details. Copyright --------- Copyright © 2009-2013 Dan Kubb. See LICENSE for details.
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
equalizer-0.0.8 | README.md |
equalizer-0.0.7 | README.md |