From: Mike Sassak Date: 2002-01-26T09:45:29+09:00 Subject: Re: "friend" alternative in Ruby? On Fri, 2002-01-25 at 19:12, 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? Hi Kate, Could you elaborate on how you want your program to work? In particular, it _sounds_ like you might be doing something like this: f = Foo.new fm = FooManager.new fm.manage(f) where perhaps something like this might be more appropriate: class FooManager def initialize @f = Foo.new end ... # rest of class here end fm = FooManager.new fm.manage_foo And of course, you can always use #send, but be warned, some consider that an "evil method". :) -mike