Class: Comparability::Comparator

Inherits:
Object
  • Object
show all
Extended by:
Comparability::Comparators::FactoryMethods
Defined in:
lib/comparability/comparator.rb

Instance Method Summary collapse

Methods included from Comparability::Comparators::FactoryMethods

chain, create, natural_order, prioritize_nil, reverse

Instance Method Details

#compare(me, other) ⇒ Object



7
8
9
# File 'lib/comparability/comparator.rb', line 7

def compare(me, other)
  me <=> other
end

#to_procObject



11
12
13
# File 'lib/comparability/comparator.rb', line 11

def to_proc
  @_to_proc ||= method(:compare).to_proc
end