-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProperty.rb
More file actions
45 lines (42 loc) · 734 Bytes
/
Property.rb
File metadata and controls
45 lines (42 loc) · 734 Bytes
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
class Property
attr_accessor :next, :prev
# @@all_properties = []
def initialize(name,location,price,can_buy = true,is_owned=false,adds_or_takes=nil)
@name = name
@location = location
@price = price
@can_buy = can_buy
@is_owned = is_owned
@adds_or_takes = adds_or_takes
# @@all_properties << self
end
def get_property_location
@location
end
def get_can_buy
@can_buy
end
def get_is_owned
@is_owned
end
def get_name
@name
end
def get_price
@price
end
def own
@is_owned = true
end
def get_adds_or_takes
@adds_or_takes
end
def set_adds_or_takes(money)
@adds_or_takes = money
end
end
# @@all_properties.each do |property|
# if property.name == "Baltic"
# # do something
# end
#end