From: Robert Klemme Date: 2004-08-14T23:06:06+09:00 Subject: Re: Opinion on ClassInherit Include "T. Onoma" schrieb im Newsbeitrag news:200408140954.24066.transami@runbox.com... > On Saturday 14 August 2004 09:41 am, ts wrote: > > svg% cat b.rb > > #!/usr/bin/ruby > > module MyMod > > attr_accessor :x > > def hix > > puts "Hi, #{@x}." > > end > > end > > > > class A > > extend MyMod > > end > > > > A.x = 'you' > > A.hix #=> Hi, you. > > svg% > > You missed the '# ...' in the example. So that dosen't work. You end up having > to have two seperate modules, one of which is included the other of which is > extended. I want a single encapsulation. You didn't say so in your original post. And as far as I can see you have two modules in your example, too. As you obviously noticed, you need to identify those parts that should go into instances and those for the class *somehow*. So having two separate modules is really the simplest way. Kind regards robert