From: Trans Date: 2005-08-02T07:11:03+09:00 Subject: Re: module / inheritance question Joe Van Dyk wrote: > class Parent extend self > def foo > puts "Parent::foo called" > end > end > > module TheModule > def boo > Parent.foo > end > end > > class Child < Parent > include TheModule > end > > Child.new.boo > > # Two questions: > # 1) Why do I need Child.boo? Shouldn't function TheModule.boo be mixed in > # to Child? Include brings in the instance-level methods not the module-level methods. > # 2) Any way I can get TheModule.boo to call Parent.foo? 'extend self' can be used to put instance-level methods on the module-level too. HTH, T.