Related questions
How to add new item to hash
I'm new to Ruby and don't know how to add new item to already existing hash. For example, first I construct hash:
hash = {item1: 1}
after that a want to add item2 so after this I have hash like this:
{item1: 1, …
How to add to an existing hash in Ruby
In regards to adding an key => value pair to an existing populated hash in Ruby, I'm in the process of working through Apress' Beginning Ruby and have just finished the hashes chapter.
I am trying to find the simplest …