module SmartCore::ValueObject::Interface::Comparable::Comparability

@api private @since 0.1.0

Public Instance Methods

<(another_object) click to toggle source

@param another_object [Any] @return [Boolean]

@api public @since 0.1.0

# File lib/smart_core/value_object/interface/comparable.rb, line 26
def <(another_object)
  false
end
<=(another_object) click to toggle source

@param another_object [Any] @return [Boolean]

@api public @since 0.1.0

# File lib/smart_core/value_object/interface/comparable.rb, line 35
def <=(another_object)
  false
end
==(another_object)
Alias for: eql?
>(another_object) click to toggle source

@param another_object [Any] @return [Boolean]

@api public @since 0.1.0

# File lib/smart_core/value_object/interface/comparable.rb, line 44
def >(another_object)
  false
end
>=(another_object) click to toggle source

@param another_object [Any] @return [Boolean]

@api public @since 0.1.0

# File lib/smart_core/value_object/interface/comparable.rb, line 53
def >=(another_object)
  false
end
eql?(another_object) click to toggle source

@param another_object [SmartCore::ValueObject] @return [Boolean]

@api public @since 0.1.0 rubocop:disable Style/RedundantSelf

# 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.__options__.all? do |property|
      self.__send__(property.name) == another_object.__send__(property.name)
    end
  )
end
Also aliased as: ==