key is called
Accessing Keys in Ruby:
Make sure that the bracket notation is used inside the loop and not a dot notation (see lines 7-9). See what happens on lines 17 through 25 when the dot notation is used.
In addition to the bracket notation (lines 7-9), notice on line 8 that the word key is not inside double quote marks, this is because it is a variable, the “placeholder” we use in the for..in loop.
Accessing Values in Ruby:
There are different methods in Ruby does the job for us. Line 11 shows you how to access the value of the “Texas” key.