From: dblack@... Date: 2003-08-12T10:52:37+09:00 Subject: Re: newbie mixin questions Hi -- On Tue, 12 Aug 2003, Gennady wrote: > ----- Original Message ----- > From: "Michael Garriss" > > > How do I seperate the class methods from the instance methods in the > > module? In my above code I'll have one extra unwanted class and one > > extra unwanted instance method. > > If you really want to separate them, well, make them separate modules. One other technique that might be relevant is Module#included, which as I understand it is essentially a new name for append_features. (Is that accurate?) Here's a 1.8.0 example: module M def self.included(c) def c.something puts "I'm a class method!" end super end def another puts "I'm an instance method!" end end The inclusion now operates, with fairly clear separation, on both the class and the instances: class A; include M; end A.something A.new.another David -- David Alan Black home: dblack@superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav