From: Timothy Goddard Date: 2006-02-11T19:08:24+09:00 Subject: Re: OpenStruct problem Hashes don't behave well as keys either so it's no surprise openstructs (which are based on them) don't. Nested hashes are usually sufficient, but I agree the hashing of hashes and openstructs is pretty strange strange. If you really need to use openstructs as keys you could use: class OpenStruct def hash @table.to_a.hash end end This is, however, very inefficient and depends on all variables stored in the openstruct also being good keys. As a general rule, a key should be a simple value. Try to avoid using complex structures as keys.