title: Best way to list where everywhere a module has been included
body: <p>Of course, to achieve what I ask for in the title, it is possible to write the following code:</p>
  
  <pre><code>module Foo
    class &lt;&lt; self
      def included receiver
        my_herd &lt;&lt; receiver
      end
  
      def my_herd; @my_herd ||= [] end
      alias where_everywhere_am_I_included my_herd
    end
  end
  
  Foo.where_everywhere_am_I_included #=&gt; []
  
  module Bar
    include Foo
  end
  
  Foo.where_everywhere_am_I_included #=&gt; [Bar]
  # etc.
  </code></pre>
  
  <p>I can imagine <em>worse</em> ways to do this, such as to search <code>ObjectSpace</code> for all the modules and grep their ancestries. What I want to know, is there a better way? Am I forgetting something, such as something like method <code>Module#included_in</code>. Am I missing something clever with eg. famous <code>#append_features</code> method? Whath better alternatives do I have?</p>
  
  <p><strong>Edited:</strong> The real world problem I am solving is related to <a href="https://github.com/boris-s/sy" rel="nofollow">my library SY</a>, which provides physical unit methods. Physical unit methods, such as <code>1.metre</code>, <code>1.m</code>, <code>1.s</code>, <code>1.lb</code>, <code>1.K</code>, tend to be simple symbols prone to collisions. Eg. <code>ActiveSupport</code> already defines time methods <code>#hour</code>, <code>#minute</code>, <code>#second</code> on <code>Numeric</code>. SY also defines methods <code>#hour</code> alias <code>#h</code>, <code>#minute</code> alias <code>#min</code>, <code>#second</code> alias <code>#s</code> on <code>Numeric</code> by the means of a mixin providing <code>#method_missing</code> reacting to the unit methods. But people who use <code>ActiveSupport</code> already have <code>#hour</code>, <code>#minute</code>, <code>#second</code> defined and therefore <code>#method_missing</code> won't kick in. They still can access <code>SY</code> methods by <code>#h</code>, <code>#min</code>, <code>#s</code> abbreviations, but that's besides the point. The point is, that people should be warned when the mixin finds possible collisions in the modules in which it is included. That would be simply achieved by coding the collision check in the <code>Module#included</code> hook. But the problem is that the user may also define the unit dynamically, such as:</p>
  
  <pre><code>PINT = Unit.of Volume, amount: 568.26.cm³
  QUART = Unit.of Volume, amount: 2.pint
  </code></pre>
  
  <p>But one can imagine that the user already has the method <code>#quart</code> defined on <code>Numeric</code>, doing something else, such as computing 1 quarter of the receiver, or returning 4th musical interval relative to the receiver etc. So when ze calls <code>QUART = Unit#of...</code> constructor, I want to ask the mixin <a href="https://github.com/boris-s/sy/blob/master/lib/sy/expressible_in_units.rb" rel="nofollow"><code>SY::ExpressibleInUnits</code></a> to report where everywhere has it been mixed in, and warn after seeing the collision in <code>Numeric</code>. I simply want to save my user from surprises and I'm wondering what is the most virtuous (using <a href="https://github.com/avdi" rel="nofollow">Avdi</a>'s trademark word) way to do it.</p>