Created
December 14, 2015 15:51
-
-
Save toddseller/7fa2de26bd017f8aa9b1 to your computer and use it in GitHub Desktop.
Enumerable Method Example 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(0...15).group_by { |i| i % 3} | |
>> {0=>[0, 3, 6, 9, 12], 1=>[1, 4, 7, 10, 13], 2=>[2, 5, 8, 11, 14]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment