Write the code to display today's day of the week using the Date class. However, only if it is Friday, please change the displayed contents as follows.
(Output contents) "Today is Monday" "Today is Friday !!!"
This time we will handle dates in Ruby, so we will use the Date class, which is a library. The first line calls the Date class from the library. You can use the wday method on the 3rd line to get today's value when it is an integer from 0 (Sunday) to 6 (Saturday).
Recommended Posts