Skip to content

Instantly share code, notes, and snippets.

@Sihui
Last active July 16, 2017 16:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Sihui/f998e4a04e962b522e95a6cd1f6d4ea8 to your computer and use it in GitHub Desktop.
Save Sihui/f998e4a04e962b522e95a6cd1f6d4ea8 to your computer and use it in GitHub Desktop.
Design Pattern: Decorator and Waffle
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