-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanimals.rb
83 lines (69 loc) · 1010 Bytes
/
animals.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
require_relative 'animodule'
class Animal
def initialize
@ridgedcellwall = false
end
end
class Mammal
def initialize
@hairfur = true
@feedmilktoyoung = true
end
def warmblooded?
true
end
end
class Amphibian
def initalize
@coldblooded = false
@carnviousadults = true
end
def verterbrate?
true
end
end
class Frog < Amphibian
def initialize
@eyesight = good
@hearing = good
end
end
class Bird
include Flight
def initialize
@havewings = true
@layeggs = true
@beaks = true
@feathers = true
end
end
class Bat < Bird
def initialize
@echolocation = true
end
end
class Parrot < Bird
def initialize
@mimicvoice = true
end
end
class Primate
include Treeswingers
def initialize
@hands = 2
@feet = 2
@brain = true
end
def hands
@hands
end
def feet
@feet
end
end
class Chimpanzee < Primate
include Treeswingers
end
Primate.new.swinging
Chimpanzee.new.swinging
Parrot.new.fly