Skip to content

Commit 2347daf

Browse files
committed
Food Shopping Method
1 parent f8ecc72 commit 2347daf

File tree

1 file changed

+78
-0
lines changed

1 file changed

+78
-0
lines changed

shopping_methods.rb

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# # Morning Routine
2+
3+
# # method without variables
4+
5+
# def ass_hat (material)
6+
# materials = ['nylon' 'cotton' 'wool']
7+
8+
# if materials.inclue?(material.downcase)
9+
# "Built ass hat with #{material}"
10+
# else
11+
# "Sorry can't do that"
12+
# end
13+
# end
14+
15+
# puts ass_hat ("leather")
16+
17+
18+
19+
20+
21+
22+
# def ass_hat (level, warm, material)
23+
# "You're an ass hat of level #{level}!! You R rating is #{ass_hat_warm_rating (warm)} and material is #{material}."
24+
# end
25+
26+
# def ass_hat_warm_rating(warm_rating)
27+
# warm_rating * 2
28+
# end
29+
30+
# ass_hat_level = 5
31+
32+
# puts ass_hat(ass_hat_level, 25) #same as puts ass_hat(5)
33+
34+
# puts ass_hat(ass_hat_level, 45, "nylon")
35+
36+
# puts ass_hat(ass_hat_level, 12)
37+
38+
# puts ass_hat(ass_hat_level, 8)
39+
40+
41+
42+
43+
44+
def sunday
45+
"Time to go food shopping!"
46+
end
47+
48+
def shopping_list(list, time, money)
49+
"Today you have to purchase #{list} at #{places_to_shop}. You have #{time} minutes and #{money} dollars."
50+
end
51+
52+
def places_to_shop
53+
"whole_foods, king_supers, or safeway"
54+
end
55+
56+
57+
# puts shopping_list('milk eggs', "60", "50")
58+
59+
list = "milk and eggs"
60+
61+
time = "60"
62+
63+
money = "50"
64+
65+
puts shopping_list(list, time, money)
66+
67+
68+
69+
# puts places_to_shop('whole_foods', 'king_supers', 'safeway')
70+
71+
store1 = "whole_foods"
72+
73+
store2 = "king_supers"
74+
75+
store3 = "safeway"
76+
77+
# puts places_to_shop(store1, store2, store3)
78+

0 commit comments

Comments
 (0)