title: Trying to execute a method in another script when a selection in the menu is made
body: <p>I'm new to programming and I'm trying to create a basic finance tracking terminal application. I am trying to get the method to run that is in another script when I make a menu selection.
  It brings me to the options &quot;Add Income&quot; and &quot;Deduct Expenses&quot; when I select &quot;Make changes to your balance&quot; but when I select &quot;Add Income&quot; or &quot;Deduct Expenses&quot; it does not execute the either method.
  It worked before but not entirely as intended, I've made minor changes and now it has stopped working and it's got me lost.</p>
  <p>What is it that I am doing wrong and how can I do this better?</p>
  <pre><code>index.rb
  
  require &quot;tty-prompt&quot;
  require_relative (&quot;./income_and_expenses.rb&quot;)
  $prompt = TTY::Prompt.new
  
  selection = &quot;&quot;
  
  puts &quot;Welcome to FinView, a terminal application that helps you track your finances.
  With the help of FinView you are able to document your income and expenses.&quot;
  
  def main_menu
      return $prompt.select(&quot;What would you like to do?&quot;,
      [&quot;Make changes to your balance&quot;, 
      &quot;View current balance&quot;, 
      &quot;View breakdown of income and expenses&quot;, 
      &quot;Create or delete a category&quot;, 
      &quot;Exit&quot;])
  end
  
  income_expense_selection = &quot;&quot;
  def income_and_expenses_menu
      return $prompt.select(&quot;What would you like to do?&quot;,
      [&quot;Add Income&quot;,
      &quot;Deduct Expenses&quot;,
      &quot;Return to Main Menu&quot;])
  end
  
  while selection != &quot;Exit&quot;
      selection = main_menu
      system &quot;clear&quot;
      case selection
      when &quot;Make changes to your balance&quot;
          income_and_expenses_menu
      when &quot;View current balance&quot;
          puts &quot;balance&quot;
      when &quot;View breakdown of income and expenses&quot;
          puts &quot;breakdown&quot;
      when &quot;Create or delete a category&quot;
          puts &quot;category&quot;
      when &quot;Exit&quot;
          exit
      end
  end
  
  while income_expense_selection != &quot;Return to Main Menu&quot;
      income_expense_selection = income_and_expenses_menu
      system &quot;clear&quot;
      case income_expense_selection
      when &quot;Add Income&quot;
         income 
      when &quot;Deduct Expenses&quot;
          expenses
      when &quot;Return to Main Menu&quot;
          main_menu
      end
  end
  </code></pre>
  <p>The 2nd script I am trying to access is</p>
  <pre><code>income_and_expenses.rb
  
  def expenses
      categories_hash = {
          :Bills =&gt; 0,
          :Utilities =&gt; 0,
          :Groceries =&gt; 0
      }
  
      puts &quot;Type in the category you would like add expenses to&quot;
      puts categories_hash.keys
      chosen_category = gets.chomp.capitalize
  
      if chosen_category == &quot;Bills&quot;
          puts &quot;What amount?&quot;
          expense_amount = gets.chomp.to_i
          categories_hash = expense_amount
      end
      puts &quot;Your expenses for #{:Bills} has included the amount of #{expense_amount}&quot;
  end
  
  def income
      puts &quot;Please enter your income&quot;
      balance = gets.chomp.to_i
      puts &quot;Your added income is #{balance}&quot;
  end
  </code></pre>