From: ts Date: 2005-11-26T21:23:12+09:00 Subject: Re: `finalize' method? >>>>> "D" == Daniel Schierbeck writes: D> What would you call such an approach? Encapsulating? I use this often D> enough that I think it would fit lovely in a module: A bad approach, at least for me. D> def self.new(*args) D> yield obj = __new__(*args) D> obj.finalize if obj.respond_to? :finalize D> end There is a convention in ruby : the method ::new must return an object of the class. You must change the name of the method if its return nil, or another object. Guy Decoux