From: vladare@... (Vlad) Date: 2004-06-07T23:33:42+09:00 Subject: Re: How to ducktype a Hash? "Sean O'Dell" wrote in message news:<200406041915.32644.sean@celsoft.com>... > In both cases, does that mean that the object has hash-like functionality, or > just that the object responds to those two methods? Is there some definition > somewhere that says "it's a hash if it has these methods?" I actually have > hash-like objects that DON'T respond to either of those two methods, but it > would be easy enough to add fake ones. I hate adding fake methods just to id > a hash interface, it's a kludge. > > Sean O'Dell Guess, you will be happy if Ruby can do some like ... obj.respond_to?(Hash::[]) or obj.respond_to?(Foo::[]) Isn't it ? Vladare