Dave Burt wrote:
> Trans wrote:
>> Somone else mentioned this. Is it true?
> 
> This says Module#included " should be used in preference to 
> Module.append_features if your code wants to perform some action when a 
> module is included in another."
> 
> http://www.ruby-doc.org/core/classes/Module.html#M000704
> 
> Cheers,
> Dave 

   module M
     def self.included(klass)
       puts "Included in #{klass}"
     end
   end

   class A
     include M  # -> Included in A
   end

   class B
     M.append_features(self)  # Nothing
   end

As you can see, Module#append_features doesn't call the .included method 
on the module, include does.


Cheers,
Daniel