In article <20020126100223I.aamine / mx.edit.ne.jp>,
Minero Aoki  <aamine / mx.edit.ne.jp> wrote:
>Hi,
>
>  In mail ""friend" alternative in Ruby?"
>    kturing / yahoo.com (kate turing) wrote:
>
>> I have a class "Foo". It has a method "doSecretStuff" that I want to
>> be callable from within class "FooManager". But I don't want
>> "Foo.doSecretStuff" to be completely public.
>> 
>> I could compromise and just make "Foo.doSecretStuff" public. But
>> surely there's a way. How would the Ruby experts accomplish this?
>
>You can use Object#__send__ to call private methods.
>
>  class Foo
>    private
>    def doSecretStuff
>      puts 'ok'
>    end
>  end
>
>  #Foo.new.doSecretStuff           # causes error
>  Foo.new.__send__ :doSecretStuff   # this is OK

but the regular 'send' seems to also work for calling private methods, 
what's the difference between '__send__' and 'send'?

Phil