Sha256: dd065f8d961e4158d019ded937b2eb8f5a5a6b8f498bc8153abc4adc9aa99628
Contents?: true
Size: 290 Bytes
Versions: 32
Compression:
Stored size: 290 Bytes
Contents
module Enumerable # File activesupport/lib/active_support/core_ext/enumerable.rb, line 94 def index_by return to_enum :index_by unless block_given? Hash[map { |elem| [yield(elem), elem] }] end def uniq_by h = {} inject([]) {|a,x| h[yield(x)] ||= a << x} end end
Version data entries
32 entries across 32 versions & 2 rubygems