Instantly share code, notes, and snippets.

Embed
What would you like to do?
Design Pattern: Template Method and Chipotle
require 'date'
class DietOrderSihui < DietOrder
def vessel
Bowl
end
def meat
Steak
end
def is_cheat_day?
Date.today.day == 10
end
end
class DietOrderAmber < DietOrder
def vessel
Burrito
end
def meat
Chicken
end
def is_cheat_day?
Date.today.day == 25
end
end
@mrcreel

This comment has been minimized.

mrcreel commented Dec 20, 2017

Line 5 should be Bowl not Bowel
Bowel is funnier, but...

@Sihui

This comment has been minimized.

Owner

Sihui commented Dec 20, 2017

Thanks for pointing out, Michael!
Updated :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment