-
Notifications
You must be signed in to change notification settings - Fork 0
/
ej1.rb
115 lines (80 loc) · 1.15 KB
/
ej1.rb
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
module Caminacion
def caminar
puts "Estoy caminando"
end
end
module Nadacion
def nadar
puts "Estoy nandando"
end
end
module Volacion
def volar
puts "Estoy volando"
end
end
module Desplazacion
def desplazar
puts "Estoy desplazandome"
end
end
class Animal
end
class Mamifero < Animal
end
class Hombre < Mamifero
include Caminacion
include Nadacion
def hablar
puts "Hablo."
end
end
class Perro < Mamifero
include Caminacion
def ladrar
puts "Ladro."
end
end
class Ballena < Mamifero
include Nadacion
end
class Ave < Animal
include Caminacion
end
class Aguila < Ave
include Volacion
end
class Pinguyno < Ave
include Nadacion
end
class Reptil < Animal
end
class Cocodrilo < Reptil
include Caminacion
include Nadacion
end
class Boa < Reptil
include Desplazacion
def consstriccion
puts "Constricciono."
end
end
class Cobra < Reptil
include Desplazacion
def morder
puts "Muerdo."
end
end
class Anfibio < Animal
include Nadacion
end
class Sapo < Anfibio
def saltar
puts "Salto."
end
end
class Pez < Animal
include Nadacion
end
class Tiburon < Pez
end