From: Ruby Admirer Date: 2007-03-23T01:13:23+09:00 Subject: Re: About class methods visibility (public/private) --0-1601649241-1174580000=:4288 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit >Phrogz wrote: >> I don't really understand what you mean. >> Please, read again my post. >> I love Ruby (my pseudo is Ruby Admirer) and public_class_method and >> private_class_method are already parts of Ruby ! >No, they're not: >C:\>irb >irb(main):001:0> Object.public_class_methods >NoMethodError: undefined method `public_class_methods' for >Object:Class >from (irb):1 >irb(main):002:0> Object.private_class_methods >NoMethodError: undefined method `private_class_methods' for >Object:Class >from (irb):2 Of course, public_class_methods and private_class_methods do not exist ! BUT public_class_method and private_class_method DO exist !! Do not put an extra 's' ! You can try within IRB : Module.private_class_method and it will work. Likewise, you will have an explanation for the method with : ri private_class_method See also the Pickaxe book. It seems that from the beginning, there is a lot of misunderstanding on my questions ! --------------------------------- Food fight? Enjoy some healthy debate in the Yahoo! Answers Food & Drink Q&A. --0-1601649241-1174580000=:4288--