title: Ruby: "in `<=': comparison of Fixnum with Array failed (ArgumentError)"
body: <p>Hopefully something less newbish than my last...</p>
  
  <p>Anyhow, I am doing a bit of coding on a small app that simplifies numbers down to primes, mainly to help with small things like homework.</p>
  
  <p>However, a particular method is giving me the error mentioned in the title:</p>
  
  <pre><code>def get_simps(num)  
    curr = 2  
    print("Working...")  
    while (curr &lt;= num)  
      #If they divide cleanly, then it's a simplified form  
      if (num % curr == 0)  
        res = [curr, num / curr]  
        break  
      end  
      curr += 1  
    end  
    print("\n")  
    return res    
  end    
  </code></pre>
  
  <p>Where the argument <em>num</em> is supplied by this statement:</p>
  
  <pre><code>print("Insert number here: ")  
  num = gets().chomp().to_i()  
  </code></pre>
  
  <p>Thus making the error weird: why does it say I compare a Fixnum and an ARRAY? I also did this:</p>
  
  <pre><code>if (num.class() == curr.class())  
   print "Cheese"  
  end  
  </code></pre>
  
  <p>and it printed Cheese. Why the reason for the error, then?</p>