Rails Array Count Occurrences of Elements
names.inject(Hash.new(0)) { |total, e| total[e] += 1 ;total}
Encouraging Emu
names.inject(Hash.new(0)) { |total, e| total[e] += 1 ;total}