From: Brian Candler Date: 2011-04-21T00:25:39+09:00 Subject: Re: Can I check contain value in hash? Robert K. wrote in post #993961: > My first choice would be to use Set and not Hash as values. OK, although Set is really just a thin wrapper around Hash(*), and I find it easier to work with objects of one class instead of a two. Regards, Brian. (*) example methods from class Set: def size @hash.size end def empty? @hash.empty? end def clear @hash.clear self end def to_a @hash.keys end def include?(o) @hash.include?(o) end def add(o) @hash[o] = true self end def delete(o) @hash.delete(o) self end -- Posted via http://www.ruby-forum.com/.