Sha256: 4d0b23a5f3e2c62ac772a11c1e9f0128c7cc2cce0e7ef6efb2a2dc26e38f037f

Contents?: true

Size: 176 Bytes

Versions: 10

Compression:

Stored size: 176 Bytes

Contents

class Array

  def every(num=1)
    index = 0
    while self[index]
      yield(*(1..num).to_a.inject([]) { |acc, n| acc<<self[index+n-1] })
      index+=num
    end
  end

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
core_extend-0.2.1 lib/core_extend/array.rb
core_extend-0.2.0 lib/core_extend/array.rb
core_extend-0.1.9 lib/core_extend/array.rb
core_extend-0.1.8 lib/core_extend/array.rb
core_extend-0.1.7 lib/core_extend/array.rb
core_extend-0.1.5 lib/core_extend/array.rb
core_extend-0.1.4 lib/core_extend/array.rb
core_extend-0.1.3 lib/core_extend/array.rb
core_extend-0.1.2 lib/core_extend/array.rb
core_extend-0.1.0 lib/core_extend/array.rb