Skip to content

Instantly share code, notes, and snippets.

@bleything
Forked from reinh/gist:401551
Created May 14, 2010 19:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bleything/401553 to your computer and use it in GitHub Desktop.
Save bleything/401553 to your computer and use it in GitHub Desktop.
module Enumerable
def frequencies
counts = Hash.new(0)
self.each{|item| counts[item] +=1}
return counts
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment