Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/rutt/helper.rb

Instance Method Summary collapse

Instance Method Details

#/(len) ⇒ Object



2
3
4
5
6
7
8
9
# File 'lib/rutt/helper.rb', line 2

def / len
  a = []
  each_with_index do |x, i|
    a << [] if i % len == 0
    a.last << x
  end
  a
end