Hchanging value of hash associated with a particular key

I am a novice in Ruby. I want to change the value of hash associated
with a particular key.

H = Hash[“a” => 100, “b” => 200]
I want the value associated with a=>300 and this change should be
permanent.

Please give the methods except
hash.[key]=value

http://www.ruby-doc.org/core-1.9.3/Hash.html

irb(main):001:0> h = {“a” => 100, “b” => 200}
=> {“a”=>100, “b”=>200}
irb(main):002:0> h.store ‘a’, 300
=> 300
irb(main):003:0> h
=> {“a”=>300, “b”=>200}

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs