I have a hashtable that I'm using to store variables as values. I want to be able to change those variables by looking them up in the hash, but I can't think of a way to do this without changing the value itself.
bar = "ruby"
foo = {key: bar}
foo
#=> { "key" => "ruby" }
foo[:key] = "rails"
foo
#=> { "key" => "rails" }
How do I alter a variable stored as a value in a hash, instead of altering the hash itself?