Skip to content

Instantly share code, notes, and snippets.

@dLobatog
Created June 24, 2013 21:27
Show Gist options
  • Save dLobatog/5853751 to your computer and use it in GitHub Desktop.
Save dLobatog/5853751 to your computer and use it in GitHub Desktop.
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