Created
June 24, 2013 21:27
-
-
Save dLobatog/5853751 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
is_weekday = lambda {|day_of_week, time| time.wday == day_of_week}.curry | |
sunday = is_weekday[0] | |
monday = is_weekday[1] | |
tuesday = is_weekday[2] | |
wednesday = is_weekday[3] | |
thursday = is_weekday[4] | |
friday = is_weekday[5] | |
saturday = is_weekday[6] | |
case Time.now | |
when sunday | |
puts "Day of rest" | |
when monday, tuesday, wednesday, thursday, friday | |
puts "Work" | |
when saturday | |
puts "chores" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment