-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfhcastle_personal_chef.rb
More file actions
69 lines (56 loc) · 1.17 KB
/
fhcastle_personal_chef.rb
File metadata and controls
69 lines (56 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
require 'date'
class PersonalChef
def countdown(counter)
while counter > 0
puts "The counter is #{counter}"
counter = counter - 1
end
return self
end
def water_status(minutes)
if minutes < 7
puts "The water is not boiling yet."
elsif minutes == 7
puts "It's just barely boiling"
elsif minutes == 8
puts "It's boiling!"
else
puts "Hot! Hot! Hot!"
end
return self
end
def inventory
produce = {"apples" => 3, "oranges" => 1, "carrots" => 12}
produce.each do |item, quantity|
puts "There are #{quantity} #{item} in the fridge."
end
end
def make_toast(color)
puts "Get your own #{color} toast!"
return self
end
def make_eggs(quantity)
quantity.times do
puts "Making you #{quantity} green eggs!"
end
puts "I'm done!"
return self
end
def make_milkshake(flavor)
puts "Your liver and #{flavor} milkshake is ready"
return self
end
def good_morning
today=Date.today.strftime("%A")
day_of_year=Date.today.yday
puts "Happy #{today}, it is the #{day_of_year} day of 2012"
end
end
class Butler
def open_front_door
puts "You rang?"
end
def open_door(location)
puts "The #{location} door is now open"
end
end