Method: Enumerable#partial_sort_by

Defined in:
lib/jinx/helpers/enumerable.rb

#partial_sort_byEnumerable

Sorts this collection’s members with a partial sort operator on the results of applying the block.

Returns:

  • (Enumerable)

    the items in this collection in partial sort order



235
236
237
# File 'lib/jinx/helpers/enumerable.rb', line 235

def partial_sort_by
  partial_sort { |item1, item2| yield(item1) <=> yield(item2) }
end