Project

General

Profile

Feature #11879

Updated by nobu (Nobuyoshi Nakada) over 8 years ago

`Module#included_modules` include prepended modules: 

 ~~~ruby 
 

     module A; end 
 
     module B; end 
 
     A.prepend B 
 
     A.included_modules # => [B] 
 ~~~ 

 This is confusing, and is not useful. I think prepended modules should not be included in `Module#included_modules`. 

 ~~~ruby 
 

     A.included_modules # => [] 
 ~~~ 

 I also propose that prepended modules should be included in a new method `Module#prepended_modules`: 

 ~~~ruby 
 

     A.prepended_modules # => [B] 
 ~~~

Back