From: Kevin Smith Date: 2001-09-21T05:22:31+09:00 Subject: [ruby-talk:21460] Re: chain methods inside and outside the class; how to intermingle mine and Strings' methods? --- "Frykholm, Niklas" wrote: > self.class.new(self.gsub /\d/,'') (snip) > Your class, HoX should be as polite, that is why > delete_digits should use self.class.new rather than > HoX.new, it makes it possible for someone to create a > subclass of HoX and chain the method calls. Nice bit about new--I hadn't thought of that. But wouldn't this be the same (and slightly simpler)? self.class.new(gsub /\d/,'') Or perhaps (I don't have Ruby in front of me) this: class.new(gsub /\d/,'') Kevin __________________________________________________ Terrorist Attacks on U.S. - How can you help? Donate cash, emergency relief information http://dailynews.yahoo.com/fc/US/Emergency_Information/