From: "Brian Schröder" Date: 2005-11-16T18:10:59+09:00 Subject: Re: Nested classes On 16/11/05, Groleo Marius wrote: > hi list. > > I have the following code: > > #! /usr/bin/ruby > > > class B > def fun_b > p "B" > end > end > > class A > b = B.new > end > > a = A.new > a.b.fun_b > > The part that bugs me is this error: > ./test.rb:15: undefined method `b' for # (NoMethodError) > > What is the way to code the above ideea, so that the last line would be correct. > > I'm running ruby 1.8.3 (2005-09-21) [i486-linux]. > What problem do you want to solve? Is this maybe nearer to you goals: class A class B def fun_b p "B" end end end A::B.new.fun_b cheers, Brian -- http://ruby.brian-schroeder.de/ Stringed instrument chords: http://chordlist.brian-schroeder.de/