Rubyで配列をある要素数ごとに分割する場合は Enumerable#each_slice が利用できる。 [1, 2, 3, 4, 5, 6, 7, 8, 9, 10].each_slice(3){|part| p part ...
確定! 回上一頁