Categories: None [Edit]
array_groups
[1,2,3,4,5].in_groups(2) => [ [1,2,3], [4,5] ]
-------------------------------------------------------
[1,2,3,4,5].in_groups_of(2) => [ [1,2], [3,4], [5] ]
-------------------------------------------------------
[1,2,3,4,5].in_groups_of(2, nil_fill: true) => [ [1,2], [3,4], [5,nil] ]
-------------------------------------------------------
This allows the grouping of an array into different "groups". Great for threading long arrays by group or making them rectangular.
Total
Ranking: 42,590 of 188,678
Downloads: 27,786
Daily
Ranking: 109,889 of 188,661
Downloads: 1
Downloads Trends
Ranking Trends
Num of Versions Trends
Popular Versions (Major)
Popular Versions (Major.Minor)
Depended by
| Rank | Downloads | Name |
|---|
Depends on
| Rank | Downloads | Name |
|---|
Owners
| # | Gravatar | Handle |
|---|---|---|
| 1 | mrmicrowaveoven |