Class: Array
- Inherits:
-
Object
- Object
- Array
- Defined in:
- lib/makitzo/monkeys/array.rb
Direct Known Subclasses
Instance Method Summary collapse
Instance Method Details
#in_groups_of(group_size) ⇒ Object
2 3 4 5 6 7 8 9 |
# File 'lib/makitzo/monkeys/array.rb', line 2 def in_groups_of(group_size) out = [] each_with_index do |ele, i| out << [] if i % group_size == 0 out.last << ele end out end |