title: Ruby case statement with multiple variables using an Array
body: <p>I'd like to compare multiple variables for a case statement, and am currently thinking overriding the case equals operator (===) for Array is the best way to do it.  Is this the best way? </p>
  
  <p>Here is an example use case: </p>
  
  <pre><code>def deposit_apr deposit,apr 
    # deposit: can be nil or 2 length Array of [nil or Float, String]  
    # apr: can be nil or Float     
    case [deposit,apr] 
      when [[Float,String],Float] 
        puts "#{deposit[0]} #{deposit[1]}, #{apr*100.0}% APR"
      when [[nil,String],Float] 
        puts "#{apr*100.0}% APR on deposits greater than 100 #{deposit[1]}"
      when [[Float,String],nil] 
        puts "#{deposit[0]} #{deposit[1]}"
      else 
        puts 'N/A' 
    end
  end
  </code></pre>
  
  <p>The only problem is the Array case equals operator doesn't apply the case equal to the elements of the Array.  </p>
  
  <pre><code>ruby-1.9.2-p0 &gt; deposit_apr([656.00,'rupees'],0.065)
  N/A
  </code></pre>
  
  <p>It will if I override, but am not sure what I'd be breaking if I did: </p>
  
  <pre><code>class Array
    def ===(other)
      result = true
      self.zip(other) {|bp,ap| result &amp;&amp;= bp === ap}
      result
    end
  end
  </code></pre>
  
  <p>Now, it all works: </p>
  
  <pre><code>ruby-1.9.2-p0 &gt; deposit_apr([656.00,'rupees'],0.065)
  656.0 rupees, 6.5% APR
  </code></pre>
  
  <p>Am I missing something? </p>