[ruby-core:96663] [Ruby master Feature#11879] `Module#prepended_modules`

[email protected] Sat, 04 Jan 2020 19:05:51 +0000 (UTC)
Newsgroups gmane.comp.lang.ruby.core
Message-ID <redmine.journal-83633.20200104190550.ca201b5403ce14c0@ruby-lang.org>
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:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>