public Method

Module.append_features(p1)

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.

Source Code

/*
*  call-seq:
*     append_features(mod)   => mod
*  
*  When this module is included in another, Ruby calls
*  <code>append_features</code> 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 <code>Module#include</code>.
*/

static VALUE
rb_mod_append_features(module, include)
   VALUE module, include;
{
   switch (TYPE(include)) {
     case T_CLASS:
     case T_MODULE:
       break;
     default:
       Check_Type(include, T_CLASS);
       break;
   }
   rb_include_module(include, module);

   return module;
}
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.