Sha256: f74208d5224706262951b2549a81401ae4159701c75b8e2841406385043700a6
Contents?: true
Size: 409 Bytes
Versions: 8
Compression:
Stored size: 409 Bytes
Contents
module Hiccup module CoreExt module EnumerableExtensions def to_histogram self.each_with_object(Hash.new { 0 }) do |item, histogram| pattern = block_given? ? yield(item) : item histogram[pattern] += 1 end end end end end Enumerable.send(:include, Hiccup::CoreExt::EnumerableExtensions) Array.send(:include, Hiccup::CoreExt::EnumerableExtensions)
Version data entries
8 entries across 8 versions & 1 rubygems