Skip to content

Instantly share code, notes, and snippets.

@rubenarakelyan
Created October 30, 2024 11:34
Show Gist options
  • Save rubenarakelyan/a40103e30bb23ff8e21f607de8088379 to your computer and use it in GitHub Desktop.
Save rubenarakelyan/a40103e30bb23ff8e21f607de8088379 to your computer and use it in GitHub Desktop.
Get next day of the week
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