RobertDober/lab42_streams

View on GitHub
lib/lab42/stream/core/enumerable.rb

Summary

Maintainability
A
35 mins
Test Coverage
module Enumerable
  def ordered_by beh

    sort do | a, b |
      a == b ? 0 : (
        beh.(a, b) ? -1 : 1
    )
    end

  end
end