From: Joel VanderWerf Date: 2005-07-28T02:57:33+09:00 Subject: Re: What's so special about operators, built-in classes and modules? Very nice technique, but... Ara.T.Howard wrote: > module M > module ClassMethods > end > module InstanceMethods > end > include InstanceMethods > self.extend ClassMethods > def self::included other > class << other > include InstanceMethods ^^^^^^^^^^^^^^^^^^^^^^^ This is redundant. > end > other.extend ClassMethods > end > end For the newbies: In the old, old days (1.6 maybe), we had to use #append_features instead of #included, and that did require explicitly including the module. And sometimes we had to whack it with a dinosaur bone to make it work. Btw, the doc for append_features is unclear (as someone else on this thread pointed out) about the difference between including a module and adding methods: ------------------------------------------------- Module#append_features append_features(mod) => mod ------------------------------------------------------------------------ When this module is included in another, Ruby calls +append_features+ in this module, passing it the receiving module in _mod_. Ruby's default implementation is to add the constants, methods, and module variables of this module to _mod_ if this module has not already been added to _mod_ or one of its ancestors. See also +Module#include+.