From: Ilan Berci Date: 2007-03-16T05:20:54+09:00 Subject: Re: General Ruby OOP Question - using inheritance or include unknown wrote: > > module X; def x; "x"; end; end > class Y; extend X; end > Y.x #=> "x" > > Unfortunately, I'm fairly sure that would require separate modules for > class methods (through extend) and instance methods (through include). Although the approach above is the one that I use, for the sake of completenes there is also this... irb(main):001:0> module X; def x; "x"; end; end => nil irb(main):002:0> class Y irb(main):003:1> class << self irb(main):004:2> include X irb(main):005:2> end irb(main):006:1> end => # irb(main):007:0> Y.x => "x" -- Posted via http://www.ruby-forum.com/.