-
-
Save anonymous/6db82eed90e85229c70195f26fde8ce1 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
def chunked | |
return enum_for(:each) unless block_given? | |
each.chunk(&:year).each do |year, timestamps| | |
yield year, timestamps.chunk(&:month) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment