Sha256: adbda0b22a50bad58de9966168c5056e060d4d2200bcc795bb92ca99e8b9b47d

Contents?: true

Size: 203 Bytes

Versions: 4

Compression:

Stored size: 203 Bytes

Contents

module Enumerable

  # Taken from Ruby Facets.
  def group_by #:yield:
    #h = k = e = nil
    r = Hash.new
    each{ |e| (r[yield(e)] ||= []) << e }
    r
  end unless method_defined?(:group_by)

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
dnote-1.6.1 lib/dnote/core_ext.rb
dnote-1.6.0 lib/dnote/core_ext.rb
dnote-1.4.0 lib/dnote/core_ext.rb
dnote-1.3.1 lib/dnote/core_ext.rb