title: problems with ruby symbols in hash look-up
body: <p>I'm trying to create a simple hash to look up for corresponding strings to some symbols (:student_number, :first_name, ...). I'm having issue retrieving data from this function though. Here's the function</p>
  
  <p>Snippet A</p>
  
  <pre><code>  def get_nice_column_name(col_symbol)
      column_names = { 
        :first_name =&gt; "Student's First Name",
        :last_name =&gt; "Student's Last Name", 
        :email =&gt; "Student's Email", 
        :given_name =&gt; "Student's Given Name"
      }
      return column_names[col_symbol]
    end
  </code></pre>
  
  <p>Here's how I use it, but <strong>not working</strong>:</p>
  
  <p>Snippet B</p>
  
  <pre><code>col_titles = []
  params = {:first_name =&gt; 'true', 
            :last_name =&gt; 'true', 
            :email =&gt; 'true', 
            :given_name =&gt; 'true' }
  
  params.each do |key, value|
    if ( value == 'true')
      col_titles &lt;&lt; get_nice_column_name(key)
    end
  end
  </code></pre>
  
  <p>When I look into col_titles, I expect ["Student's First Name", "Student's Last Name"], but I actually don't get anything, just [] empty array.</p>
  
  <p>I thought that was weird so I tried printing out the object_id of the symbols (col_symbol in snippet A) and the symbols in the hash column_names, I get different object_ids. I'm wondering why they are different (they both present the same symbols). If I add this to the function get_nice_column_name in Snippet A:</p>
  
  <pre><code>    puts "col_symbol is " + col_symbol.object_id.to_s + ", while :first_name is " + (:first_name).object_id.to_s
      puts "col_symbol is " + col_symbol.object_id.to_s + ", while :last_name is " + (:last_name).object_id.to_s
      puts "col_symbol is " + col_symbol.object_id.to_s + ", while :email is " + (:email).object_id.to_s
      puts "col_symbol is " + col_symbol.object_id.to_s + ", while :given_name is " + (:given_name).object_id.to_s
  </code></pre>
  
  <p>I would get this in the console </p>
  
  <pre><code>col_symbol is 98351040, while :first_name is 1221688
  col_symbol is 98351040, while :last_name is 580888
  col_symbol is 98351040, while :email is 168888
  col_symbol is 98351040, while :given_name is 1290648
  </code></pre>
  
  <p>983541040 doesn't really match any of the {1221688, 580888, 168888, 1290648}. Is this why my get_nice_column_name is useless ? Because the symbols are different under the hood?</p>
  
  <p>Thanks for your help guys !</p>
  
  <p>Regards</p>