From: dblack@... Date: 2006-06-16T18:56:23+09:00 Subject: Re: Why the lack of mixing-in support for Class methods? Hi -- On Fri, 16 Jun 2006, Yukihiro Matsumoto wrote: > Hi, > > In message "Re: Why the lack of mixing-in support for Class methods?" > on Fri, 16 Jun 2006 01:10:53 +0900, ara.t.howard@noaa.gov writes: > > |is this by design? > | > | harp:~ > cat b.rb > | require 'class_extension' > | module M > | class_extension{ attr_accessor 'a' } > | end > | M.a # exception! > > Yes. class_extension add features to the target class but not to the > module itself. > > class C > include M > end > M.a = 42 > p M.a # => 42 Will this happen if the module is included in another module? If so, I'm wondering whether a more generic name, without "class" in it, could be used instead of "class_extension". David -- David A. Black (dblack@wobblini.net) Ruby Power and Light, LLC (http://www.rubypowerandlight.com) See what the readers are saying about "Ruby for Rails"! http://www.rubypowerandlight.com/quotes