title: Ruby : uninitialized constant
body: <p>I don't know what I'm missing here, unable to call a function inside an another function in ruby</p>
  
  <p>Example:</p>
  
  <pre><code>def test()
    puts WB_A
  end
  
  # Top level components
  def WB_A
    {
      'A'            =&gt; 'Apple',
    }
  end
  
  test()
  </code></pre>
  
  <p>Results in: </p>
  
  <blockquote>
    <p>main.rb:2:in <code>test': uninitialized constant WB_A (NameError)  from main.rb:12:in</code>'</p>
  </blockquote>
  
  <p>Please let me know what's the mistake</p>