rails return hash if key value pair code example Example: ruby assign value to hash grades = Hash.new grades["Dorothy Doe"] = 9