title: Confused about the million ways to reach inside Ruby Hash with the symbol sign
body: <p>I am drowning in the million ways to access Hash. </p>
  
  <pre><code>condition1 = {
      "e" =&gt;1
  }
  
  condition2 = {
      "e":1
  }
  
  condition3 = {
      :"e" =&gt;3
  }
  
  
  condition4 = {
      e:4
  }
  
  
  condition5 = {  # 100% sure not working because of syntax error
      e=&gt;5
  }
  
  condition6 = {  # 100% sure not working because of syntax error
      :e:6
  }  
  
  condition7 = {
      :e=&gt;7
  }
  
  puts condition1["e"]
  puts condition2["e"]
  puts condition3[:e]
  puts condition4[:e]
  puts condition7[:e]
  </code></pre>
  
  <p><strong>Output</strong>:</p>
  
  <pre><code>1
                                       (nothing)
  3
  4
  7
  </code></pre>
  
  <p><strong>First question: For the first 2 puts statement,</strong> why is it working for the first one but not the second one?  In both hashes, I am using Strings as keys. Is it because I used "=>" in the first Hash and thus the string is actually being read as Symbols? So it is actually being processed like :"e" =>1?  </p>
  
  <p><strong>Second question: That leads to my second question about the third condition</strong>, I was told that if I used Symbol sign before a quote, what happens in the background is that the quote will be ignored. That's why I was able to access it through simply :e without the quotes. Is that true? However if that's true,  then the first question becomes more confusing. If in the first condition, "e"=>1 was evaluated as :"e" =>1, then shouldn't the quotes be ignored? Thus eventually it's read as :e =>1. Then how come I was able to access it with only the quotes?</p>
  
  <p><strong>Third question: So how do I access the second condition?</strong> I know it's not recommended to use strings as key values. However what if in a certain case I have already created it with strings, how do I access it? I have tried accessing it through a variable name but it's still not outputing anything. </p>
  
  <p>Thank you so much for reading this. I know it's definitely not worth it to care too much about these details. But I ran into it today and can't really move on without figuring out what the HECK is going on !!</p>