title: Ruby: Open Module's singleton
body: <p>So in a Ruby class, you can use an idiom such as <code>class &lt;&lt; self</code> like the following:</p>
  
  <pre><code>class SalesOrganization
    def self.find_new_leads
      ...
    end
    class &lt;&lt; self
       include ::NewRelic::Agent::Instrumentation::ControllerInstrumentation
       add_transaction_tracer :find_new_leads, :category =&gt; :task
    end
  end
  </code></pre>
  
  <p>My question is what if <code>SalesOrganization</code> is actually a <code>Module</code> instead of <code>Class</code>. Is this doing what I'm hoping it would do, or am I opening up some black magic that I shouldn't be dabbling with?</p>
  
  <pre><code># Potentially terrible code
  module SalesOrganization
        def self.find_new_leads
          ...
        end
        class &lt;&lt; self
           include ::NewRelic::Agent::Instrumentation::ControllerInstrumentation
           add_transaction_tracer :find_new_leads, :category =&gt; :task
        end
  end
  </code></pre>
  
  <p>How do I access a modules singleton class?</p>