module Augmented::Symbols::Comparing::Helpers

Public Class Methods

make_compare_function(method_name, operator, value) click to toggle source
# File lib/augmented/symbols/comparing.rb, line 35
def self.make_compare_function method_name, operator, value
  if value.equal? NO_VALUE
    -> thing, other { thing.__send__(method_name).__send__(operator, other.__send__(method_name)) }
  else
    -> thing        { thing.__send__(method_name).__send__(operator, value) }
  end
end