title: Rails NoMethodError when calling a method from a constant
body: <p>I'm trying to call a method inside a class constant. It returns a <code>NoMethodError</code>. Here's a sample code:</p>
  <pre class="lang-rb prettyprint-override"><code>class TestingA
    CONSTANT_HERE = { details: get_details('example.json') }
  
    def get_details(file)
      # retrieve details here
    end
  end
  </code></pre>
  <p>The error that appears is:</p>
  <pre><code>NoMethodError (undefined method `get_details' for TestingA:Class)
  </code></pre>
  <p>Any ideas on why?</p>