From: Greg Weeks Date: 2007-11-09T08:39:20+09:00 Subject: Re: standard, pretty, and flexible meta-methods? Gavin Kistner wrote: > The various Rails libraries generally define class methods as > 'instance' methods in modules and extend classes with those modules to > add the class methods to various classes. > > However, as you've no doubt seen in rails, most of the end user > functionality of the framework is achieved by subclassing (as with my > example based on ActiveRecord). The Rails programmer does not write: > > class Person > include ActiveRecord::Validations (I assume that "include" above is a typo for "extend".) Thanks again. I don't know why I was obsessed with this issue, but it is a relief to resolve it. (The "However ..." part was obvious, but you couldn't know that without reading my mind.) BTW, I just got a hold of "The Ruby Way" a couple minutes ago. The very first words inside it are: "Among other things, this book excels at explaining metaprogramming, one of the most interesting aspects of Ruby. Many of the early ideas for Rails were inspired by the first edition, especially what is now chapter 11..." -- David Heinemeier Hansson, Creator of Ruby on Rails. So, combine that with your responses, and I'm about as assuaged as a curious person can be. -- Posted via http://www.ruby-forum.com/.