Last active
February 19, 2020 17:30
-
-
Save 7even/ac9a471922c973aff40fb43f12bac21e to your computer and use it in GitHub Desktop.
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
module Enumerable | |
def my_each_slice(num, &block) | |
offset = 0 | |
while offset < count | |
yield self.to_a[offset, num] | |
offset += num | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment