Created
September 29, 2018 03:37
-
-
Save rachidcalazans/9b819a35f0ea68f03c8a60a3d7e19db8 to your computer and use it in GitHub Desktop.
Design Patterns in Ruby - Template Method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cappuccino = Cappuccino.new | |
cappuccino.prepare_recipe | |
# => boil water | |
# => brew cappuccino grinds | |
# => pour in cup | |
# => add sugar | |
tea = Tea.new | |
tea.prepare_recipe | |
# => boil water | |
# => steep the bag | |
# => pour in cup | |
# => add lemon |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment