Sha256: 061948c1f8276e15ccaffc06e49d6b27976c84de5b89e49c56e110af8466e149
Contents?: true
Size: 329 Bytes
Versions: 8
Compression:
Stored size: 329 Bytes
Contents
class Array # # TODO # active_supportに同様のメソッドが無いかどうかの確認 # def split_by(num) return [] if self.size < 1 ret = [[]] counter = 0 self.each do |val| (counter = 0;ret << []) if counter >= num ret[-1] << val counter += 1 end return ret end end
Version data entries
8 entries across 8 versions & 1 rubygems