Skip to content

Instantly share code, notes, and snippets.

@jpotts18
Last active December 18, 2015 06:10
Show Gist options
  • Save jpotts18/1f4269c9e1f22c963a0d to your computer and use it in GitHub Desktop.
Save jpotts18/1f4269c9e1f22c963a0d to your computer and use it in GitHub Desktop.
class MorningAlgorithm
# This method is used to encapsulate the algorithm's general process.
# Notice this method is not concerned how the methods are accomplished
def execute
wake_up
workout
eat_breakfast
drive_to_work
end
def wake_up
puts "Get up you lazy bum"
end
def workout
puts "1, 2, 3... That should work"
end
def eat_breakfast
puts "Mmm mmm tasty"
end
def drive_to_work
puts "Good morning crazy drivers!"
end
end
morning = MorningAlgorithm.new()
morning.execute
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment