title: Universal settings in Sinatra
body: <p>I have a class in Sinatra where I set some settings (from JSON, as it happens): </p>
  
  <pre><code>class Pavo &lt; Sinatra::Base
    configure :development do
      set :config, JSON.parse(File.open(File.dirname(__FILE__) + "/pavo.configuration.development.json", "rb").read)
      set :config_mtime, File.mtime(File.dirname(__FILE__) + "/pavo.configuration.development.json")
    end
  
    [...]
  
    get '/' do
      puts "whatever"
    end
  end
  </code></pre>
  
  <p>And that class has a model, that is required to read those settings.</p>
  
  <pre><code>class Resolver &lt; Sinatra::Base
    def get_data(workpid)
      url_str = settings.config['public']['BOOKS_DATA_SERVICE_URL'].gsub('${WORKPID}', workpid)
      return Resolver.get_json(url_str)
    end
    [...]
  end
  </code></pre>
  
  <p>However, the Resolver class can't do it: undefined method `config' for Resolver:Class.</p>
  
  <p>Maybe I have the wrong scope, or I should be using Sinatra::Application?</p>