From: Caleb Clausen Date: 2010-04-25T03:02:03+09:00 Subject: Re: #object_hexid On 4/24/10, Caleb Clausen wrote: > 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.... Oh, but I see now that this doesn't work for many builtins like Array, Hash, Integer, Float, String, true, Symbol.... I didn't expect that.