2011-02-08 Enumerable#each_slice ruby 今まで知らなかった。これは便利!! (1..10).each_slice(3) {|a| p a} # outputs below [1, 2, 3] [4, 5, 6] [7, 8, 9] [10]