Module#included_modules and prepended modules
The documentation for Module#included_modules currently states "Returns the list of modules included in +mod+."
This was never perfectly accurate, as the list also contains modules included in +mod+'s ancestors.
It now also includes prepended modules.
This is consistent with
include? that returns true for prepended modules, but not quite consistent with
included that does not get called for prepended modules.
Matz, could you confirm that current behavior is what you want?
If so, we should fix the documentation of
Updated by byroot (Jean Boussier) 3 months ago
Module#included is not called when the module is prepended
I think that's fine, because it calls
Module#include? and Module#included_modules regard prepended modules as included (not well documented)
class Base end module A end module B end Base.prepend(A) Base.include(B) p Base.included_modules
[A, B, Kernel]