From: Dave Thomas Date: 2000-12-20T03:39:45+09:00 Subject: [ruby-talk:7703] Re: (Maybe) a correction for Programming Ruby "Christoph Rippel" writes: > If I run > > module A > def A.append_features(aModule) > p "module A was included in #{aModule} but #{aModule}.foo was not defined" > end > def foo > end > end > > class B > include A > end > > x = B.new > x.foo > > I end up with > >>"module A was included in B but B.foo was not defined" > >>rr.rb:14: undefined method `foo' for # (NameError) Because you never called the _real_ append features, so the method was never added: module A def A.append_features(aModule) super #<<< call the real one... p "module A was included in #{aModule}" end def foo end end class B include A end x = B.new x.foo then foo will be defined. Regards Dave