module Equatable::Methods

The equality methods

Public Instance Methods

==(other) click to toggle source

Compare two objects for equality based on their value and being a subclass of the given class.

@param [Object] other

the other object in comparison

@return [Boolean]

@api public

# File lib/equatable.rb, line 145
def ==(other)
  other.is_a?(self.class) && compare?(__method__, other)
end
eql?(other) click to toggle source

Compare two objects for equality based on their value and being an instance of the given class.

@param [Object] other

the other object in comparison

@return [Boolean]

@api public

# File lib/equatable.rb, line 132
def eql?(other)
  instance_of?(other.class) && compare?(__method__, other)
end