class Partyhat::Activity
Public Class Methods
new(name, score, rank)
click to toggle source
# 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
Public Instance Methods
compare_to(another_activity)
click to toggle source
# File lib/partyhat/activity.rb, line 30 def compare_to another_activity Partyhat::ActivityComparison.new(self, another_activity) end
human_name()
click to toggle source
# File lib/partyhat/activity.rb, line 18 def human_name Partyhat::Stat.human_name_for @name end
name()
click to toggle source
# File lib/partyhat/activity.rb, line 14 def name @name end
rank()
click to toggle source
# File lib/partyhat/activity.rb, line 26 def rank @rank end
score()
click to toggle source
# File lib/partyhat/activity.rb, line 22 def score @score end