Module: Virtus::Equalizer::Methods
- Defined in:
- lib/virtus/support/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
122 123 124 125 |
# File 'lib/virtus/support/equalizer.rb', line 122 def ==(other) return false unless self.class <=> other.class cmp?(__method__, other) end |
#eql?(other) ⇒ Boolean
Compare the object with other object for equality
107 108 109 |
# File 'lib/virtus/support/equalizer.rb', line 107 def eql?(other) instance_of?(other.class) and cmp?(__method__, other) end |