Module: LunaPark::Extensions::Comparable::InstanceMethods

Defined in:
lib/luna_park/extensions/comparable.rb

Instance Method Summary collapse

Instance Method Details

#enable_debugObject Also known as: debug

Enable debug mode (just include debug methods)



81
82
83
84
# File 'lib/luna_park/extensions/comparable.rb', line 81

def enable_debug
  self.class.enable_debug
  self
end

#eql?(other) ⇒ Boolean Also known as: ==

Compare this object with other using methids, described with ‘::comparable_attributes` method

Returns:

  • (Boolean)


71
72
73
74
75
# File 'lib/luna_park/extensions/comparable.rb', line 71

def eql?(other)
  return false unless other.is_a?(self.class)

  self.class.comparable_attributes_list.all? { |attr| send(attr) == other.send(attr) }
end