From: Rupert Voelcker Date: 2008-12-16T18:12:31+09:00 Subject: Re: Unique values in hash? > I have a hash that contains duplicate data, for example, :username => > "alex" comes many times. > I want to loop around and print their names just once (only unique). In > simple loop it would print "alex" repeatedly. hash.map { |k,v| v }.uniq.each { |name| puts name } should do it Rupert