module BlockParty::Configuration::Comparison
Public Instance Methods
==(other)
click to toggle source
Compare values only, class doesn’t matter
# File lib/block_party/configuration/comparison.rb, line 9 def == other if other.respond_to?(:to_hash) to_hash == other.to_hash end end
===(other)
click to toggle source
Compare classes or instances for case statements
Calls superclass method
# File lib/block_party/configuration/comparison.rb, line 23 def === other unless other.is_a? Class to_hash(false) == other.to_hash if other.respond_to? :to_hash else super end end
eql?(other)
click to toggle source
Compare values only, class matters
# File lib/block_party/configuration/comparison.rb, line 16 def eql?(other) if other.respond_to?(:to_hash) as_hash == other.to_hash end end