From: Pokkai Dokkai Date: 2007-12-02T23:43:18+09:00 Subject: Re: alias problem Morton Goldberg wrote: > On Dec 2, 2007, at 12:20 AM, Pokkai Dokkai wrote: > >> i want like this (ofcourse below is wrong) >> c1.view ----->from view >> Cls1.pp >> c1.view ----->undefined method `view' for # >> (NoMethodError) > > > I don't believe you can do what I think you want with 'alias'. Maybe > the following will work for you. > > > class Cls1 > def view > puts "from view" > end > end > > c1 = Cls1.new > c1.view > > class Cls1 > private :view > end > > c1.view > > > > from view > NoMethodError: private method �view� called for # level > in untitled document at line 14 > > > Regards, Morton actualluy all ruby classes are not closed (we can add anything at any time) like as above so how to close a ruby class ? i thing freeze is used to protect modification for object. like that what is used to protect modification for class ? -- Posted via http://www.ruby-forum.com/.