From: Vitaliy Yanchuk Date: 2010-07-21T04:28:09+09:00 Subject: Re: Count occurences of vars in array Check this out ['a', 'b', 'a', 'b', 'c', 'c', 'c'].group_by{|o|o}.collect{|k,v|{k,v.size}}.to_yaml" Result: - a: 2 - b: 2 - c: 3 -- Posted via http://www.ruby-forum.com/.