Created
July 16, 2017 16:26
-
-
Save Sihui/8011dfc0c47030d7f36cb969bd2eda94 to your computer and use it in GitHub Desktop.
Design Pattern: Decorator and Waffle
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
class StrawberryWaffle < WaffleDecorator | |
def topping | |
'strawberries' | |
end | |
end | |
class BlueberryWaffle < WaffleDecorator | |
def topping | |
'blueberries' | |
end | |
end | |
class BlackberryWaffle < WaffleDecorator | |
def topping | |
'blackberries' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment