From: Trans Date: 2005-12-01T02:32:30+09:00 Subject: Re: ClassMethods: Module creation hook / Capitalized method David A. Black wrote: > I didn't know there was a widely-known or standard technique of that > name (and I wouldn't use the term "inherited" to describe what happens > to methods in modules; it muddies the waters a bit), but if you mean > the kind of thing that's done in ActiveRecord and related libraries to > promote instance methods of a module to pseudo-class-methods of > classes that include the module's containing module, then yes :-) > (I say "pseudo" because they're not actually class methods, but they > end up being useable as if they were.) We've talked about this before. And I'm not sure we need to get into it again, but I don't see how you say they are not class methods when the module is being included (extended) into the class adhoc (i.e. it's singleton). > I think the pseudo-ness of the class method-ness of these methods is > an issue here. You're really redefining the notion of a class method; > it's no longer a singleton method of a class object. I imagine > some counter-argument involving the word "duck" could probably be > developed... :-) But classes already work this way! How does allowing modules do the same thing change any such notion? > But I'm personally not a big fan of just asserting > that something is a class method when that's really not the right term > for it. (I have the same problem with the ClassMethods module > technique. It works by a kind of consensus, but I don't consider it > an optimal naming scheme.) Well ask Nodu about it, AFAIK he was the originator of the idea: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/35979 Personally I had been calling it ClassInheritable (though you probably think that's even worse) but since ClassMethods is commonly used I figure it best to stick with whats known. I agree it may not be the best name --a bit overly general IMO, but then again I think this should be the default behavior in the first place and a seprate module ought to be needed to NOT inherit along the singleton chain --as you are aware frm the RCR. > I'm confused -- do you have a ClassMethods module lurking somewhere? Presently you can find both ClassMethods and #class_inherit in the latest Facets. These will be usurped by an improved melding of the two available in Calibre, which I am tweaking presently which is why I brought this thread up. T.