Skip to content

Instantly share code, notes, and snippets.

@Sihui Sihui/diet_order_cd_c.rb
Last active Dec 20, 2017

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.

Copy link

commented Dec 20, 2017

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

@Sihui

This comment has been minimized.

Copy link
Owner Author

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
You can’t perform that action at this time.