Skip to content

Instantly share code, notes, and snippets.

@adamburmister
Created December 10, 2012 10:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamburmister/4249776 to your computer and use it in GitHub Desktop.
Save adamburmister/4249776 to your computer and use it in GitHub Desktop.
require 'Date'
# precondition: assumed days_of_our_lives is defined as a range, and
# purpose? method is defined (left as an exercise for the implementor) of this class.
days_of_our_lives.reduce do |life, time|
level += 1 and eat 'cake' if Date.today.day == 10 && Date.today.month == 12
purpose?(life, time)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment