Last active
January 8, 2018 00:24
-
-
Save Sihui/8cf1a045aca702e1b5a907c76a2431ab to your computer and use it in GitHub Desktop.
This file contains hidden or 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 PizzaStore | |
attr_accessor :pizza_prototype_collection | |
def initialize | |
@pizza_prototype_collection = {} | |
end | |
def take_order(pizza_type) | |
pizza_prototype = pizza_prototype_collection[pizza_type] | |
raise 'unsupported pizza type' unless pizza_prototype | |
pizza = pizza_prototype.clone | |
pizza.bake | |
pizza | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment