Top Level Namespace
Defined Under Namespace
Modules: NaturalSort
Instance Method Summary collapse
-
#NaturalSort(input) ⇒ NaturalSort::Key
Conversion-style helper (in the spirit of Integer()/Array()): wraps
inputin a NaturalSort comparison key for use as a sort_by key, e.g.
Instance Method Details
#NaturalSort(input) ⇒ NaturalSort::Key
Conversion-style helper (in the spirit of Integer()/Array()): wraps input in a NaturalSort comparison key for use as a sort_by key, e.g. list.sort_by { |x| NaturalSort(x) }. Opt-in — requiring this file defines it at the top level, so it lands on Kernel and is callable on every object.
12 13 14 |
# File 'lib/natural_sort/kernel.rb', line 12 def NaturalSort(input) NaturalSort.key(input) end |