module Virtus::Equalizer::Methods

The comparison methods

Public Instance Methods

==(other) click to toggle source

Compare the object with other object for equivalency

@example

object == other  # => true or false

@param [Object] other

the other object to compare with

@return [Boolean]

@api public

# File lib/virtus/support/equalizer.rb, line 122
def ==(other)
  other.kind_of?(self.class) && cmp?(__method__, other)
end
eql?(other) click to toggle source

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

# File lib/virtus/support/equalizer.rb, line 107
def eql?(other)
  instance_of?(other.class) && cmp?(__method__, other)
end