Module: Dry::Core::Equalizer::Methods
- Defined in:
- lib/dry/core/equalizer.rb
Overview
The comparison methods
Instance Method Summary collapse
-
#==(other) ⇒ Boolean
Compare the object with other object for equivalency.
-
#eql?(other) ⇒ Boolean
Compare the object with other object for equality.
Instance Method Details
#==(other) ⇒ Boolean
Compare the object with other object for equivalency
135 136 137 |
# File 'lib/dry/core/equalizer.rb', line 135 def ==(other) other.is_a?(self.class) && cmp?(__method__, other) end |
#eql?(other) ⇒ Boolean
Compare the object with other object for equality
120 121 122 |
# File 'lib/dry/core/equalizer.rb', line 120 def eql?(other) instance_of?(other.class) && cmp?(__method__, other) end |