-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgit.rb
More file actions
89 lines (60 loc) · 1.24 KB
/
git.rb
File metadata and controls
89 lines (60 loc) · 1.24 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
module ADrinkWithThat
class Pop
def self.pepsi
"Ah, the cold bite of this really hits the spot!"
end
def self.drPepper
print "Blech, Theres too many flavors in this!"
end
end
class Juice
def orangeJuice
"mmmmm Oranges...."
end
def tang
print "Its a kick in a glass!"
end
end
end
module Makeitbetter
attr_accessor :condiment
def initialize(condiment = "Tobasco Sauce")
@condiment = condiment
end
def addCondiment
"mmmm... This #{@condiment} will make it taste better..."
end
end
class Lunch
include Makeitbetter
def self.buyFood
"Bought a burger, Alllright!"
end
def self.drink
print "\nIce Cold Water"
end
def eatWhatsHere
"Yuck."
end
end
class Dinner
include Makeitbetter
end
wednesday = Lunch.new
puts wednesday.eatWhatsHere
puts Lunch.buyFood
puts wednesday.addCondiment
wednesday.condiment = "Salt"
puts wednesday.addCondiment
drink = ADrinkWithThat::Pop.pepsi
print drink + "\n"
ADrinkWithThat::Pop.drPepper
print "\n" + ADrinkWithThat::Juice.new.orangeJuice
module ADrinkWithThat
class Lunch < Lunch
def temperature (temp)
"Water at a nice #{temp} temperature, delicious!"
end
end
end
print "\n" + ADrinkWithThat::Lunch.new.temperature("HOT")