Class: Partyhat::Activity
- Inherits:
-
Stat
- Object
- Stat
- Partyhat::Activity
show all
- Defined in:
- lib/partyhat/activity.rb
Constant Summary
Constants inherited
from Stat
Stat::ActivitiesList, Stat::CombatSkillsList, Stat::HumanNames, Stat::List, Stat::SkillsList
Instance Method Summary
collapse
Methods inherited from Stat
human_name_for
Constructor Details
#initialize(name, score, rank) ⇒ Activity
Returns a new instance of Activity.
7
8
9
10
11
12
|
# File 'lib/partyhat/activity.rb', line 7
def initialize name, score, rank
raise ArgumentError, 'Invalid activity name' unless ActivitiesList.include? name
@name = name
@score = score < 0 ? nil : score
@rank = rank < 0 ? nil : rank
end
|
Instance Method Details
#compare_to(another_activity) ⇒ Object
#name ⇒ Object
14
15
16
|
# File 'lib/partyhat/activity.rb', line 14
def name
@name
end
|
#rank ⇒ Object
26
27
28
|
# File 'lib/partyhat/activity.rb', line 26
def rank
@rank
end
|
#score ⇒ Object
22
23
24
|
# File 'lib/partyhat/activity.rb', line 22
def score
@score
end
|