Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/intermine/query.rb

Instance Method Summary collapse

Instance Method Details

#every(count) ⇒ Object Also known as: /


29
30
31
32
33
34
35
36
# File 'lib/intermine/query.rb', line 29

def every(count)
  chunks = []
  each_with_index do |item, index|
    chunks << [] if index % count == 0
    chunks.last << item
  end
  chunks
end