From: "marcandre (Marc-Andre Lafortune)" Date: 2012-05-07T07:15:34+09:00 Subject: [ruby-core:44913] [ruby-trunk - Bug #6408] DelegateClass#eql? and <=> don't work as expected Issue #6408 has been updated by marcandre (Marc-Andre Lafortune). Hi, In your patch, for both `if obj.equal? self`, shouldn't it be `if obj.is_a? Delegator`? For many classes that define their comparison operators, this might not be sufficient if you want comparison operators to work well, as they typically will first check on the class of the object to compare with. Defining `is_a?` to return true for either Delegator or the class delegated to might be more helpful. tenderlovemaking (Aaron Patterson) wrote: > It seems these two methods aren't delegating to the delegate object when compared against itself. > > I've attached a patch with tests and a fix. It seems nobody is the maintainer for delegate.rb (according to the wiki), so if nobody objects, I will apply this patch. ---------------------------------------- Bug #6408: DelegateClass#eql? and <=> don't work as expected https://bugs.ruby-lang.org/issues/6408#change-26498 Author: tenderlovemaking (Aaron Patterson) Status: Open Priority: Normal Assignee: Category: Target version: ruby -v: ruby 2.0.0dev (2012-05-06 trunk 35548) [x86_64-darwin11.3.0] It seems these two methods aren't delegating to the delegate object when compared against itself. I've attached a patch with tests and a fix. It seems nobody is the maintainer for delegate.rb (according to the wiki), so if nobody objects, I will apply this patch. -- http://bugs.ruby-lang.org/