Issue #11879 has been updated by sawa (Tsuyoshi Sawada).


Indeed this issue is a duplicate. Please close this.

----------------------------------------
Feature #11879: `Module#prepended_modules`
https://bugs.ruby-lang.org/issues/11879#change-83633

* Author: sawa (Tsuyoshi Sawada)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
----------------------------------------
`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]
~~~



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>