From: Caleb Clausen Date: 2010-04-25T02:55:13+09:00 Subject: Re: #object_hexid On 4/24/10, Intransition wrote: > I recently got an error report from someone using 1.8.6: > > 1) Failure: test_object_hexid(TCKernel) [./test/core/kernel/ > test_object_hexid.rb:8]: > <"#"> expected but was > <"#">. > > I know what's causing this in my current implementation, but I've been > down this road before -- I tweak the implementation to satisfy one > error report and another seems to crop up. So I was hoping someone > might have a definitive answer. Try this way?: class Object def hexid Object.instance_method(:inspect).bind(self).call[/:(.*?)[> ]/,1] end end Ugly, but seems like it ought to be fairly universal. Well, it won't work with BlankSlate/BasicObject, but other than that....