title: How to get a method to run on an array
body: <p>I have been doing code Katas on codewars and I wanted to see if I could run them on my computer. But while I can devise various methods I can’t get any of them to run using Command Prompt with Ruby. E.g.</p>
  
  <pre><code>def sum_array(arr)      
    if arr.kind_of?(Array) and arr.length &gt; 2       
     arr.inject(:+) - arr.min - arr.max  
    else        
     0  
    end  
  end 
  
  puts sum_array = [1, 2, 3, 4]
  </code></pre>
  
  <p>Instead of returning 5 it just gives me the unmodified array.</p>
  
  <p>What is the correct way for me to get the method to work on an array?</p>