所以我有这个哈希。它看起来像这样:
{
'arg0' => '126150656000',
'arg1' => 'Intel(R) Core(TM) i7-2640M CPU @ 2.80GHz',
'arg2' => '2790',
'arg3' => '3276320768',
'arg4' => '8467496960',
'arg5' => 'Windows 7',
'arg6' => '6.1',
'arg7' => 'amd64',
'arg8' => '2',
'arg9' => '1920',
'arg10' => '1200',
'arg11' => '32',
}
哈希需要根据键的 'argN' 位置转换为位置参数数组。像这样。
[
'126150656000',
'Intel(R) Core(TM) i7-2640M CPU @ 2.80GHz',
'2790',
'3276320768',
'8467496960',
'Windows 7',
'6.1',
'amd64',
'2',
'1920',
'1200',
'32'
]
这里的目标是[0] == ['arg0']
, [1] == ['arg1']
, [N] == ['argN']
。
笔记:
不能保证键的顺序正确。例如,上面的哈希可能有“arg9”“之前”“arg4”。很抱歉没有说清楚。