Marry Jane Marry Jane - 8 months ago 20
Ruby Question

How to increase 1 number value for a Hash?

@participants[id]={nick: nick, points: 0}
=> {"1"=>{:nick=>"Test", :points=>0}

I want to add in points for ID
. I did
but it does not work. How do I make it to add 1 each time?


@participants["1"] is also an hash, so

@participants["1"][:points] += 1