Created
October 30, 2024 11:34
-
-
Save rubenarakelyan/a40103e30bb23ff8e21f607de8088379 to your computer and use it in GitHub Desktop.
Get next day of the week
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
DAYS = %w[Sunday Monday Tuesday Wednesday Thursday Friday Saturday].freeze | |
def next_day(current_day) | |
DAYS.at((DAYS.find_index(current_day) + 1) % DAYS.length) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment