title: Having trouble with Ruby hashes
body: <p>I'm using Watir and Ruby to try and slurp a load of data from a web application into a hash:</p>
  
  <pre><code>def getOrders( )
  
      return orders = slurpOrders()
  
  end
  
  def containsOrderNumber( orderNumber )
      puts orderNumber 
      orders = getOrders
      puts orders[orderNumber]
      #puts orders.keys
  
      puts "orders has_key? = " + orders.has_key?(orderNumber).to_s
      return orders.has_key?(orderNumber)
  
  end
  
  private
  def slurpOrders( ) 
  
      puts @browser.tables[6].row_count
  
      rows = @browser.tables[6].rows
  
      orders = Hash.new
  
      for row in rows do
          #puts row.column_count
          if row.column_count == 8 then
              order = {
                  :sales_channel =&gt; row[2],
                  :customer =&gt; row[3],
                  :country =&gt; row[4],
                  :total =&gt; row[5],
                  :time =&gt; row[6],
                  :highlight =&gt; row[7],
                  :credit_hold =&gt; row[8],
              }
              orders[ row[1] ] = order
  
              #puts row[1]
  
          end
      end
  
      return orders
  
  end
  </code></pre>
  
  <p>So I'm calling containsOrderNumber( '1136050' ) in another script but orders.has_key? returns false and orders[orderNumber] returns nil.</p>
  
  <p>However, if I uncomment puts orders.keys, it appears as one of the keys in the hash...? I'm super confused - what am I doing wrong? Is something weird happening data-type-wise?</p>
  
  <p>Cheers</p>