Skip to content

Instantly share code, notes, and snippets.

@7even
Last active February 19, 2020 17:30
Show Gist options
  • Save 7even/ac9a471922c973aff40fb43f12bac21e to your computer and use it in GitHub Desktop.
Save 7even/ac9a471922c973aff40fb43f12bac21e to your computer and use it in GitHub Desktop.
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