lib/domain/support/equalizer.rb in domain-1.0.0.rc2 vs lib/domain/support/equalizer.rb in domain-1.0.0.rc3
- old
+ new
@@ -29,25 +29,10 @@
# @api public
def hash
equality_components.map{|c| c.hash }.reduce(self.class.hash, :^)
end
- # Compare the object with other object for equality
- #
- # @example
- # object.eql?(other) # => true or false
- #
- # @param [Object] other
- # the other object to compare with
- #
- # @return [Boolean]
- #
- # @api public
- def eql?(other)
- instance_of?(other.class) and cmp?(__method__, other)
- end
-
# Compare the object with other object for equivalency
#
# @example
# object == other # => true or false
#
@@ -59,9 +44,10 @@
# @api public
def ==(other)
return false unless self.class <=> other.class
cmp?(__method__, other)
end
+ alias :eql? :==
private
def cmp?(comparator, other)
equality_components.zip(other.equality_components).