Last active
April 23, 2017 16:34
-
-
Save Sihui/e437896431796395ef2eefbba179360f to your computer and use it in GitHub Desktop.
For [Design Patterns in Life and Ruby](https://medium.com/series/design-patterns-in-life-and-ruby-fcde31ba51a0/edit)
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 Burger | |
attr_reader :top_bun, :bottom_bun | |
attr_accessor :stuffing | |
def initialize(stuffing) | |
@top_bun = TOP_BUN | |
@stuffing = stuffing | |
@bottom_bun = BOTTOM_BUN | |
end | |
def cook | |
burger = [] | |
burger << top_bun.cook | |
burger << stuffing.cook | |
burger << bottom_bun.cook | |
burger | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment