Last active
July 16, 2017 16:08
-
-
Save Sihui/f998e4a04e962b522e95a6cd1f6d4ea8 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 Waffle | |
attr_reader :waffle | |
def initialize | |
@waffle = 'This is a waffle' | |
end | |
def serve | |
puts waffle | |
end | |
def eat | |
puts 'Eat a bit of the waffle' | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment