Assuming I have 2 strings constants
KEY1 = "Hello"
KEY2 = "World"
I would like to create a hash using these constants as key values.
Trying something like this:
stories = {
KEY1: { title: "The epic run" },
KEY2: { title: "The epic fail" }
}
Doesn't seem to work
stories.inspect
#=> "{:KEY1=>{:title=>\"The epic run\"}, :KEY2=>{:title=>\"The epic fail\"}}"
and stories[KEY1]
obviously doesn't work.