hash pairs ruby code example Example 1: change key value hash ruby toto[:key] = "newvalue" Example 2: ruby not in hash session.key?("user")