Issue #8026 has been updated by matz (Yukihiro Matsumoto).

Status changed from Open to Feedback

I basically accept the idea.

But according to the slide, the optional `include_ancestors` is true, but it does mean cherry-picking prepended modules from ancestor list.  I cannot think of any use case of this behavior.

Matz.


----------------------------------------
Feature #8026: Need Module#prepended_modules
https://bugs.ruby-lang.org/issues/8026#change-41468

Author: marcandre (Marc-Andre Lafortune)
Status: Feedback
Priority: Normal
Assignee: matz (Yukihiro Matsumoto)
Category: core
Target version: current: 2.1.0


We should have a way to get the list of prepended modules of a class or module.

    module Mixin
    end

    module Outer
      prepend Mixin
    end

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

See also bug #8025.


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