From: Gennady Bystritsky Date: 2004-11-21T11:53:50+09:00 Subject: Re: Inner Class Relationship On Nov 20, 2004, at 5:20 PM, Carlos wrote: > [James Edward Gray II , 2004-11-21 01.22 > CET] >> Even if I separate the two classes, my questions remain unchanged: >> What's a good way to allow one type of object to send private-ish >> messages to another type of object? >> >> As for details: My outer class is a server. My inner class is a >> connection for that server. When a connection ends, I need a way to >> notify the Server object to remove it from it's maintenance list. >> That's the message I'm wanting to hide from the outside world. How about something like this: class Outer class Inner def initialize(&block) @cleaner = block end def close @cleaner.call self end end def create_inner inner = Inner.new { |_inner| remove_inner(_inner) } ... end private ####### def remove_inner ... end end Sincerely, Gennady Bystritsky