From: Mark Bush Date: 2008-03-20T01:37:53+09:00 Subject: Re: class::new :: --> NUBY Chinna Karuppan wrote: > class KK > alias oldnew new > NameError: undefined method `new' for class `KK' You are trying to alias the *instance* method #new which doesn't exist. #new is a *class* method so you need to alias it in the metaclass. Something like: class KK end class << KK alias_method :oldnew, :new def new yield if block_given? oldnew end end (You need the class to exist first before you access the metaclass.) -- Posted via http://www.ruby-forum.com/.