From: Brian Candler Date: 2003-03-28T08:16:19+09:00 Subject: Re: How to call super with different arguments > A similar result - adding a few methods and leaving everything else > unchanged - can be obtained with singleton classes. How about this approach: Actually that didn't work when case-sensitive was true, because of the loop on <=>, but in this case you _can_ use super: def <=>(other) if @@intpattern =~ self && @@intpattern =~ other to_i <=> other.to_i elsif @@casesensitive super else downcase <=> other.downcase end end Instead of 'super' you can do 'dup <=> other'. Note that 'downcase' also duplicates the object: it's the same as dup.downcase! It seems that duplicating an object of a singleton class gives you an object of the original class, which is fortunately exactly what we needed. I suppose if it didn't, it would no longer be a singleton :-) Regards, Brian.