From: dblack@... Date: 2006-02-12T02:19:27+09:00 Subject: Re: Private methods - only available to oneself? Hi -- On Sun, 12 Feb 2006, Gene Tani wrote: > > Phrogz wrote: >> >> 2) If you are writing a class or module for use by others, they will >> have access to the source code, and could rewrite it to allow things >> you didn't intend. Use 'protected' and 'private' to indicate when the >> methods should be called under normal circumstances. But it's not a >> guarantee. > > There's a few loopholes around private and protected, e.g. subclass a > class with private methods and declare them public in the subclass, but > one of them is closed in 1.9, you can't #send private methods anymore > (ok, you can #funcall them, ...) I think there's still hope that that will disappear by 2.0 :-) David -- David A. Black (dblack@wobblini.net) Ruby Power and Light (http://www.rubypowerandlight.com) "Ruby for Rails" chapters now available from Manning Early Access Program! http://www.manning.com/books/black