我如何在哈希中创建哈希,嵌套哈希有一个键来识别它.我在嵌套哈希中创建的元素也是如何为它们设置密钥的
例如
test = Hash.new()
#create second hash with a name?? test = Hash.new("test1")??
test("test1")[1] = 1???
test("test1")[2] = 2???
#create second hash with a name/key test = Hash.new("test2")???
test("test2")[1] = 1??
test("test2")[2] = 2??
Run Code Online (Sandbox Code Playgroud)
谢谢