title: Load or write settings on program start
body: <p>Data is generated this way:</p>
  
  <pre class="lang-ruby prettyprint-override"><code>def checkConfigurationsFile
      if File.exist?("./prefs/settings.conf") == true
        configFile = File.read("./prefs/settings.conf")
        options = JSON.parse(configFile)
        configData = {:multithreading =&gt; options['multithreading'],
                      :systemCores =&gt; options['systemCores']}
        mainmenu()
  
        elsif File.exist?("./prefs/settings.conf") == false
          configData = {:multithreading =&gt; false,
                        :systemCores =&gt; 1}
  
          configFile = File.open("./prefs/settings.conf","w")
          configFile.write(JSON.pretty_generate(configData))
          configFile.close
          checkConfigurationsFile()
        else
          puts "Something went terribly wrong!"
      end
  end
  </code></pre>
  
  <p>This is a settings menu:</p>
  
  <pre class="lang-ruby prettyprint-override"><code>    def openPreferences
      puts &lt;&lt;-PREFERENCES
          ####################################################
          #|                                                |#
          #|  Preferences                                   |#
          #|  ------------------                            |#
          #|   1. Using Multithreading? (Currently #{configData[multithreading]})                                             |#
          #|  2. Adjust Multithreading (Currently #{configData[systemCores]} are used)|#
          #|                                                |#
          ####################################################
      PREFERENCES
        print "Enter a number to change settings: "
        choice = gets.i 
  
        if blablabla
        ...
  </code></pre>
  
  <p>If the user decides to alter his configurations, he needs to be able to do. But it seems like I couldn't use the data generated in the <code>checkConfigurationsFile</code> method because they are private (and it makes no sense to pass them via arguments all around the program).</p>
  
  <p>It produces this error message:</p>
  
  <pre class="lang-bash prettyprint-override"><code>Traceback (most recent call last):
          3: from dbaser.rb:214:in `&lt;main&gt;'
          2: from dbaser.rb:10:in `checkConfigurationsFile'
          1: from dbaser.rb:54:in `mainmenu'
  dbaser.rb:205:in `openPreferences': undefined local variable or method `configData' for main:Object (NameError)
  </code></pre>