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
hash.store(key, value) - Stores a key-value pair in hash.
Example:
hash #=> {"a"=>9, "b"=>200, "c"=>4} hash.store("d", 42) #=> 42 hash #=> {"a"=>9, "b"=>200, "c"=>4, "d"=>42}
Documentation