From: Phlip Date: 2009-04-03T10:59:33+09:00 Subject: Re: Class in a Class problem denize.paul@gmail.com wrote: > - I have then to check a bunch of stuff about the parameter a > - I would have a world of more hurt trying to ensure that only one B > instantiation pointed to each a > class A > class B > def initialize() > puts "b init" > print_stuff() > end > end > > def B > return B > end def B(*args) @b ||= B.new(self, *args) end > def print_stuff() > puts "here" > end > end a = A.new() b = a.B(my_args)