From: "T. Onoma" Date: 2004-08-14T22:54:28+09:00 Subject: Re: Opinion on ClassInherit Include 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. To clarify: module MyMod     module ClassInherit       attr_accessor :x       def hix         puts "Hi, #{@x}."       end     end     def hey puts "Me, too." end   end   class A     include MyMod   end   A.x = 'you'   A.hix  #=> Hi, you. A.new.hey #=> Me, too. -- T.