title: Accessing dynamically defined class as constant works only with const_get
body: <p>Given the following example:</p>
  
  <pre><code>[1] pry(main)&gt;
  [2] pry(main)&gt; module Foo
  [2] pry(main)*   Foo = 'LOL'
  [2] pry(main)*   ['Lol'].each do |elem|
  [2] pry(main)*     @elem = elem
  [2] pry(main)*     Object.const_set "Bar#{elem}", Class.new { def butts; puts "#{@elem}" end;  }
  [2] pry(main)*   end
  [2] pry(main)* end
  =&gt; ["Lol"]
  [3] pry(main)&gt; Foo.constants
  =&gt; [:Foo]
  [4] pry(main)&gt; Foo.const_get('BarLol')
  =&gt; BarLol
  [5] pry(main)&gt; Foo::Foo
  =&gt; "LOL"
  [6] pry(main)&gt; Foo::BarLol
  NameError: uninitialized constant Foo::BarLol
  from (pry):11:in `&lt;main&gt;'
  [7] pry(main)&gt;
  </code></pre>
  
  <ol>
  <li><p>Why is it when I do <code>Foo.constants</code> it returns one constant. Shouldn't it be returning <code>[:Foo, :BarLol]</code>?</p></li>
  <li><p>Also why is it that the only way you can access the value of the dynamically defined constant is to do <code>Foo.const_get('BarLol')</code>?  Why doesn't <code>Foo::BarLol</code> not work? </p></li>
  </ol>