title: Refactoring feedback for Reverse Polish Notation (RPN) or Postfix Notation
body: <p>One of the pre-work exercises for Dev Bootcamp is an RPN calculator.  I made it work but would like refactoring feedback.  Any and all help to make this code cleaner is greatly appreciated.  </p>
  
  <pre><code>class RPNCalculator
    def evaluate(rpn)
      a = rpn.split(' ')
      array = a.inject([]) do |array, i|    
        if i =~ /\d+/ 
          array &lt;&lt; i.to_i
        else
          b = array.pop(2)
          case 
            when i == "+" then array &lt;&lt; b[0] + b[1]  
            when i == '-' then array &lt;&lt; b[0] - b[1]  
            when i == '*' then array &lt;&lt; b[0] * b[1]  
            when i == '/' then array &lt;&lt; b[0] / b[1]  
          end
        end
      end
      p array.pop
    end
  end
  
  calc = RPNCalculator.new
  calc.evaluate('1 2 +')   # =&gt; 3
  calc.evaluate('2 5 *')   # =&gt; 10
  calc.evaluate('50 20 -') # =&gt; 30
  calc.evaluate('70 10 4 + 5 * -') # =&gt; 0  
  </code></pre>