Module: SmartCore::ValueObject::Interface::Comparable::Comparability Private
- Defined in:
- lib/smart_core/value_object/interface/comparable.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Instance Method Summary collapse
- #<(another_object) ⇒ Boolean
- #<=(another_object) ⇒ Boolean
- #>(another_object) ⇒ Boolean
- #>=(another_object) ⇒ Boolean
-
#eql?(another_object) ⇒ Boolean
(also: #==)
rubocop:disable Style/RedundantSelf.
Instance Method Details
#<(another_object) ⇒ Boolean
26 27 28 |
# File 'lib/smart_core/value_object/interface/comparable.rb', line 26 def <(another_object) false end |
#<=(another_object) ⇒ Boolean
35 36 37 |
# File 'lib/smart_core/value_object/interface/comparable.rb', line 35 def <=(another_object) false end |
#>(another_object) ⇒ Boolean
44 45 46 |
# File 'lib/smart_core/value_object/interface/comparable.rb', line 44 def >(another_object) false end |
#>=(another_object) ⇒ Boolean
53 54 55 |
# File 'lib/smart_core/value_object/interface/comparable.rb', line 53 def >=(another_object) false end |
#eql?(another_object) ⇒ Boolean Also known as: ==
rubocop:disable Style/RedundantSelf
63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/smart_core/value_object/interface/comparable.rb', line 63 def eql?(another_object) self.class <= another_object.class && ( self.class.__params__.all? do |attribute| self.__send__(attribute.name) == another_object.__send__(attribute.name) end ) && ( self.class..all? do |property| self.__send__(property.name) == another_object.__send__(property.name) end ) end |