lib/equalizer.rb
# Define an #cmp? method based on the instance's values identified by #keys
#
# @return [undefined]
#
# @api private
Define an #cmp. method based on the instance's values identified by #keys
Define an #cmp . method based on the instance ' s values identified by #keys
def define_cmp_method
    keys = @keys
    define_method(:cmp?) do |comparator, other|
      keys.all? do |key|
        __send__(key).public_send(comparator, other.__send__(key))
      end
    end
    private :cmp?
  end
def define_cmp_method keys = @keys define_method ( :cmp? ) do | comparator , other | keys . all? do | key | __send__ ( key ) . public_send ( comparator , other . __send__ ( key ) ) end end private :cmp? end
Define an #cmp?
Define an #cmp?
None
undefined
api
None