我在一个数组中有 Ruby 数组,如下所示:
更多数据信息在这里https://gist.github.com/theCrab/6064789
列标题为style、color、size、desc、qty、min_qty、req_qty、root_sku、offset_size
[ ["UD/BOYS-TR/SENIOR/STANDARD", "*BLACK/2SHORT LEG", "28\" W", "29\"LEG STD 男式长裤", -10, 4, 14, "00001955", 1 ], ["UD/BOYS-TR/SENIOR/STANDARD", "*BLACK/2SHORT LEG", "30\" W", "29\"LEG STD 男式长裤", -14, 6, 20, "00001955", 2 ], ["UD/BOYS-TR/SENIOR/STANDARD", "*BLACK/2SHORT LEG", "32\" W", "29\"LEG STD 男式长裤", -29, 6, 35, "00001955", 3 ], [“UD/BOYS-TR/SENIOR/STANDARD”、“*BLACK/3REG LEG”、“28\”W”、“31\”LEG STD 男式长裤”、0、3、3、“00001976”、1] , ["UD/BOYS-TR/SENIOR/STANDARD", "*BLACK/3REG LEG", "30\" W", "31\"LEG STD 男式长裤", -12, 5, 17, "00001976", 2 ], ["UD/BOYS-TR/SENIOR/STANDARD", "*BLACK/3REG LEG", "32\" W", "31\"LEG STD 男式长裤", -6, 6, 12, "00001976", 3 ] ]
我想打印一个格式良好的表格,如下所示:
style | colour | size | desc | qty | min_qty | req_qty | root_sku
-----------------------------------------------------------------
standd| red | 28 W | N/a | 4 | 5 | 1 | 00001955
| | 30 W | N/a | 9 | 5 | 4 | 00001955
| | 36 W | N/a | 10 | 5 | 5 | 00001955
| blue | 28 W | N/a | 4 | 5 | 1 | 00001955
| | 30 W | N/a | 9 | 5 | 4 | 00001955
| | 36 W | N/a | 10 | 5 | 5 | 00001955
fitted| red/blu| 28 W | N/a | 4 | 5 | 1 | 00001954
| | 30 W | N/a | 9 | 5 | 4 | 00001954
| | 36 W | N/a | 10 | 5 | 5 | 00001954
| blue | 28 W | N/a | 4 | 5 | 1 | 00001954
| | 30 W | N/a | 9 | 5 | 4 | 00001954
| | 36 W | N/a | 10 | 5 | 5 | 00001954
我怎样才能最好地穿过阵列并完成这一壮举?