# File lib/core/facets/array/occurrence.rb, line 14 def occurrence h = Hash.new(0) if block_given? each do |e| h[yield(e)] += 1 end else each do |e| h[e] += 1 end end h end