From: Ilan Berci Date: 2008-02-01T07:34:04+09:00 Subject: Re: Referring to method in enclosing class Richard Everhart wrote: > I need to do something like what is being attempted in the code below. > > The commented out code is what I can't figure out: how do methods in a > nested classes call methods in their enclosing class? Is this even > possible? > > class Enclosing > def go > Hello.new.do_say_hello > end > > def say_hello > "Hello World!" > end > > class Hello > def do_say_hello > # puts Enclosing class's say_hello method > end > end > > end Not to fear, I have used similar stuff in other languages .. I believe what you are looking for is delegates: http://www.ruby-doc.org/stdlib/libdoc/delegate/rdoc/index.html hth ilan -- Posted via http://www.ruby-forum.com/.