将ruby数组转换为连续元素对数组的最简单方法是什么?
我的意思是:
x = [:a, :b, :c, :d]
预期结果:
y #=> [[:a, :b], [:c, :d]]
ruby arrays
arrays ×1
ruby ×1