From: Erwin Abbott Date: 2007-05-28T20:56:19+09:00 Subject: Re: Tricky problem with === I think I may have come to a solution with class Object def self.=== other #puts "object: #{self} == #{other}" other.is_a? self end end It may not work in some special cases, but it seems to do the trick. It appears this is only called when comparing to an instance of Class, so case x when 55; true; end doesn't involve this method. I haven't tested this much, so I may be horribly breaking something somewhere, but so far it seems okay. However, I haven't gotten it to work when comparing to a Module, so x.extend(SomeMixin); case x when SomeMixin ... doesn't work. Module.=== doesn't seem to be involved in this test. Regards, Erwin