From: Gregory Seidman Date: 2006-04-11T00:19:12+09:00 Subject: Re: Adding in class attribute with a Module On Mon, Apr 10, 2006 at 11:58:43PM +0900, TRANS wrote: } > Is it possible to add class attributes (cattr_accessor) using a module? } > If so could you give an example? } } There is no "Ruby Way" to do this b/c Ruby's module methods aren't } inherited by classes that include them. Though I've asked for a way } man times now! [...] } Only ugly meta-programming hacks will give the sought behavior --and } even then their are corner-case complications. Does this count as ugly meta-programming? module M def self.included(klass) class << klass attr_accessor :m end end end } T. --Greg