我看过这个问题Traversing a Hash Recursively in Ruby
然而,我仍然无法做到这一点。有没有人可以帮忙(也可以解释一下)。
输入哈希:
{"." => {"foo" => {"hello" => {}, "world" => {}}, "bar" => {}}}
我只需要遍历它,而不是搜索任何东西
我看过这个问题Traversing a Hash Recursively in Ruby
然而,我仍然无法做到这一点。有没有人可以帮忙(也可以解释一下)。
输入哈希:
{"." => {"foo" => {"hello" => {}, "world" => {}}, "bar" => {}}}
我只需要遍历它,而不是搜索任何东西
1条答案
按热度按时间polkgigr1#
如果所有的值都是哈希值,这将起作用:
输出量: