From: Pit Capitain Date: 2008-08-22T14:10:14+09:00 Subject: Re: Alternatives to class variables 2008/8/21 Sam Hendley : > Well your questions got me started down the right road and I have a > solution that solves my immediate problem Great! > (though I am still interested > in the "right way" that keeps the infomration with the classes > themselves). If you don't need to support deep class hierarchies you don't need class variables, so I'd use the simpler class instance variables instead. I'm not sure why you decided to split the functionality into a module and a base class, but if you want this structure, here's how I would code it (but I don't claim to know the "right way"...) module MethodCollector def self.included( klass) klass.extend ClassMethods end module ClassMethods def addpoint(name) extra_methods << name end def add_method(name) define_method name.to_s do "MethodName is: #{name}" end addpoint(name) end end end class MethodAdderBase include MethodCollector def self.extra_methods @extra_methods ||= [] end def extra_methods self.class.extra_methods end end Regards, Pit