Last active
November 6, 2019 18:00
-
-
Save atsmith813/891afab9d421c9427aaf8e3bfcbd765c to your computer and use it in GitHub Desktop.
Update today's birthdays to be 1 year in the future
This file contains hidden or 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
# Continuing with the birthdays, todays_birthdays, session, spreadsheet, and ws objects created above... | |
(1..ws.num_rows).each do |row| | |
name = ws[row, 1] | |
birthday = todays_birthdays.find { |bday| bday[:name] == name } | |
next unless birthday | |
next_birthday = birthday[:date].next_year.to_s | |
ws[row, 2] = next_birthday | |
puts "Set #{name}'s birthday to #{next_birthday}" | |
end | |
ws.save |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment