-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathactor.rb
More file actions
55 lines (47 loc) · 1.13 KB
/
actor.rb
File metadata and controls
55 lines (47 loc) · 1.13 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
require './car'
class Actor
attr_accessor :actor_name
attr_accessor :new_car
attr_accessor :fav_type
def initialize (actor_name, fav_type)
@actor_name = actor_name
@fav_type = fav_type
end
def casting(type)
if type.eql? @fav_type
"Accept the part"
else
"think about it"
end
end
def do_tv_series?(ongoing_series)
@ongoing_series ||= ongoing_series
if ongoing_series > 0
true
else
false
end
end
def doing_movie?(ongoing_movie)
@ongoing_movie = ongoing_movie
if ongoing_movie > 0
true
else
false
end
end
def working_in
if @ongoing_series > 0 && @ongoing_movie > 0
"right now working on " + @ongoing_series + "Tv series and " + @ongoing_movie + "movies"
elsif @ongoing_series > 0 && @ongoing_movie <= 0
"Right now working on " + @ongoing_series + "Tv series"
elsif @ongoing_series <= 0 && @ongoing_movie > 0
"Right now working on " + @ongoing_movie + " movies"
else
"Right now taking a break"
end
end
def get_car(model, power, type)
@new_car ||= Car.new(2017, 200, "sport")
end
end