Created
September 7, 2010 09:44
-
-
Save erubboli/568088 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 PizzaFactory | |
def create_pizza( type ) | |
case type | |
when :ham_mushroom | |
HamMushroomPizza.new | |
when :deluxe | |
DeluxePizza.new | |
when :hawaiian | |
HawaiianPizza.new | |
else | |
raise "The pizza type #{type} is not recognized." | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment