Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有一种快速的方法可以将散列扁平化为删除键的数组?
h={:at => [10, 20], :width => 100, :height => 200}
结果:
[[10, 20], 100, 200]
有一个内置的哈希方法:h.values
h.values
这很容易:
如果您希望它按特定顺序进行,则需要做更多的工作。