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 fi
key => value
You can use double splat operator which is available since Ruby 2.0:
h = { a: 1, b: 2 } h = { **h, c: 3 } p h # => {:a=>1, :b=>2, :c=>3}