From: Jacob Fugal Date: 2006-06-21T08:48:38+09:00 Subject: Re: Achieve pure object oriented design in Ruby On 6/20/06, Robert Dober wrote: > On 6/21/06, Jacob Fugal wrote: > > One way would be to make B.new protected/private (similar to the way > > it's done in the Singleton mixin). But once you've done that, I'm not > > sure if there's a clean way to allow A to use that method -- Ruby > > doesn't have "friends" ala C++ (and I'm glad for it). Of course, once > > it's protected you *could* have A use send explicitly: > > as can anyone else :( > If that pleases the OP I do not think the anonymous class is easily > accessible, of course one can always create an accessor to the anonymous > class inside A, :( Exactly. With a language like Ruby, it's *really* hard to not let someone do something. I simply went for removing the obvious path, but not making it impossible. Jacob Fugal