3
我有以下散列:紅寶石:加入哈希鍵
{
a: {
b: {
c1: "c1 value",
c2: "c2 value",
c3: {
d: "d value
}
}
}
我怎麼能他轉換到下一個結果:
{
"a.b.c1" => "c1 value",
"a.b.c2" => "c2 value",
"a.b.c3.d" => "d value"
}
可能[將嵌套散列轉換爲平坦散列]副本(http://stackoverflow.com/questions/9647997/converting-a-nested-hash-into-a-flat-hash) – sawa
@sawa你說得對,thx – ole