title: Ruby on Rails - Module config instance variable sets to nil unexpectedly
body: <p>I'm dealing with strange problem in Ruby on Rails. <br>
  In <em>app/lib/cml.rb</em> I have:</p>
  
  <pre><code>module CML
    class &lt;&lt; self
      attr_accessor :scheduler
      def configure
        yield self
        true
      end
    end
  end
  </code></pre>
  
  <p>Then I have in <em>config/initializers/cml.rb</em>:</p>
  
  <pre><code>CML.configure do |config|
    config.scheduler = "hey"
  end
  </code></pre>
  
  <p><em>app/controllers/example_controller.rb</em></p>
  
  <pre><code>class ExampleController &lt; ApplicationController
      def action1
          logger.debug "Scheduler: #{CML.scheduler}"
          puts ""
      end
  end
  </code></pre>
  
  <p><em>app/config/routes.rb</em></p>
  
  <pre><code>Rails.application.routes.draw do
    get '/action1', to: 'example#action1'
  end
  </code></pre>
  
  <p>Problem:</p>
  
  <ol>
  <li>start server</li>
  <li>remove puts line from example_controller.rb#action1</li>
  <li>request /action1</li>
  </ol>
  
  <p>Expected behaviour: In log I see "Scheduler: hey". <br>
  Reality: In log I see "Scheduler: " (in byebug I see it's nil)<br></p>
  
  <p>Github repo with example app: <a href="https://github.com/luki215/rails-module-error" rel="nofollow noreferrer">https://github.com/luki215/rails-module-error</a></p>
  
  <p>What am I doing wrong? I see that this kind of configuration is commonly used along several gems and these gems are working just fine.Thank you!</p>