pizza-generator 0.0.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/pizza-generator.rb +56 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 374e797071f016dceaf5379ab74226d4bebd3dfa
|
4
|
+
data.tar.gz: b5b7cf6d4898d318d41579e53aadcc0dca0cc09f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27c545aff0862bd63a587ed070ecb535a9eaf2c257e9811d8f408535702b202a9f5e62e625e33a514d4e22ea90f7cb89f3cab1a84dea504845da3ba3f37a0785
|
7
|
+
data.tar.gz: ca88e6a7e258f147d022391c671a35fa14c2aa39e1d1721bfe0c5f54dbbf382672269e1c167b4f38b34c10eb8a513561b3a5fbf425c0c3f3b0352a38bbfa34c6
|
data/lib/pizza-generator.rb
CHANGED
@@ -1,5 +1,58 @@
|
|
1
1
|
class Pizza
|
2
|
-
|
3
|
-
|
2
|
+
|
3
|
+
TOPPINGS = ["Anchovies", "Bacon", "Beef", "Chorizo", "Ham", "Meatballs", "Pepperoni", "Proscuitto", "Sausage", "Basil", "Bay Leaf", "Dried Chili", "Chives", "Cilantro", "Garlic", "Oregano", "Parsley", "Pepper", "Artichoke Hearts", "Avocado", "Broccoli", "Capers", "Capicolla", "Cherry Tomatoes", "Eggplant", "Green Peppers", "Jalapeno Peppers", "Mushrooms", "Olives", "Onions", "Pineapple", "Red Onions", "Red Peppers", "Roasted Garlic", "Spinach", "Zucchini"]
|
4
|
+
CRUSTS = ["Deep Dish", "Double Decker", "Pan", "Thin Crust", "Hand Tossed", "Ultra Thin Crust"]
|
5
|
+
CHEESES = ["Cheddar", "Feta", "Goat Cheese", "Monetery Jack", "Parmesan", "Provolone", "Ricotta"]
|
6
|
+
SAUCES = ["Tomato", "Marinera", "White Sauce", "Pesto"]
|
7
|
+
|
8
|
+
attr_reader :toppings, :cheese, :sauce, :crust
|
9
|
+
|
10
|
+
def initialize(toppings, cheese, sauce, crust)
|
11
|
+
@toppings = toppings
|
12
|
+
@cheese = cheese
|
13
|
+
@sauce = sauce
|
14
|
+
@crust = crust
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.generate(quantity=2)
|
18
|
+
|
19
|
+
toppings = Pizza.toppings(quantity)
|
20
|
+
cheese = Pizza.cheese
|
21
|
+
sauce = Pizza.sauce
|
22
|
+
crust = Pizza.crust
|
23
|
+
|
24
|
+
Pizza.new(toppings, cheese, sauce, crust)
|
25
|
+
|
4
26
|
end
|
5
|
-
|
27
|
+
|
28
|
+
def ingredients
|
29
|
+
pizza_hash = {
|
30
|
+
toppings: @toppings,
|
31
|
+
cheese: @cheese,
|
32
|
+
sauce: @sauce,
|
33
|
+
crust: @crust
|
34
|
+
}
|
35
|
+
|
36
|
+
return pizza_hash
|
37
|
+
end
|
38
|
+
|
39
|
+
private
|
40
|
+
class << self
|
41
|
+
|
42
|
+
def toppings(quantity)
|
43
|
+
TOPPINGS.sample(quantity)
|
44
|
+
end
|
45
|
+
|
46
|
+
def cheese
|
47
|
+
CHEESES.sample
|
48
|
+
end
|
49
|
+
|
50
|
+
def sauce
|
51
|
+
SAUCES.sample
|
52
|
+
end
|
53
|
+
|
54
|
+
def crust
|
55
|
+
CRUSTS.sample
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|