From: ptkwt@...1.aracnet.com (Phil Tomson) Date: 2002-01-29T04:18:35+09:00 Subject: Re: "friend" alternative in Ruby? In article <20020128102233.T18909@atdesk.com>, Paul Brannan wrote: >On Sat, Jan 26, 2002 at 09:52:59AM +0900, Minero Aoki wrote: >> You can use Object#__send__ to call private methods. > >Should I be able to do this, though? There are some valid uses of >send() where I would not want to be able to call private methods. > >Is it a good idea to rely on a "feature" that is not documented? (I >have been unable to find anywhere that mentions that send() is supposed >to be able to call private methods). > You can call private methods with send() or __send__(), the latter seems to be provided in case your class defines a send() method. I proposed a 'safer' send that wouldn't call private methods in an earlier post in this thread. Phil