public Method

Module.included_modules

mod.included_modules  array

Returns the list of modules included in mod.

module Mixin
end

module Outer
  include Mixin
end

Mixin.included_modules   #=> []
Outer.included_modules   #=> [Mixin]

Source Code

/*
*  call-seq:
*     mod.included_modules -> array
*  
*  Returns the list of modules included in <i>mod</i>.
*     
*     module Mixin
*     end
*     
*     module Outer
*       include Mixin
*     end
*     
*     Mixin.included_modules   #=> []
*     Outer.included_modules   #=> [Mixin]
*/

VALUE
rb_mod_included_modules(mod)
   VALUE mod;
{
   VALUE ary = rb_ary_new();
   VALUE p;

   for (p = RCLASS(mod)->super; p; p = RCLASS(p)->super) {
if (BUILTIN_TYPE(p) == T_ICLASS) {
    rb_ary_push(ary, RBASIC(p)->klass);
}
   }
   return ary;
}
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.