From: Robert Klemme Date: 2009-09-25T06:30:12+09:00 Subject: Re: Redefining hat operator for Proc On 09/24/2009 10:47 PM, bparanj wrote: > Hello, > > I am developing a gem where I need to redefine the <=> operator for > Proc. This operator shows up in the methods list when I print the > output of methods call but I don't see it in the list of private or > protected methods. > > I know in Ruby 1.9 === operator has been redefined, but I am not able > to confirm that <=> is currently implemented in Ruby 1.9. I don't want > to over-ride the hat operator if it is already implemented for Proc. > Could someone please give me some pointers? If you do Proc.instance_method(:<=>), what do you get? If nil, then it's not overridden. Cheers robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/