class Rubygoal::Goal
Attributes
celebration_time[RW]
Public Class Methods
new()
click to toggle source
# File lib/rubygoal/goal.rb, line 5 def initialize @celebration_time = 0 end
Public Instance Methods
celebrating?()
click to toggle source
# File lib/rubygoal/goal.rb, line 9 def celebrating? celebration_time > 0 end
start_celebration()
click to toggle source
# File lib/rubygoal/goal.rb, line 13 def start_celebration self.celebration_time = 3 end
update(elapsed_time)
click to toggle source
# File lib/rubygoal/goal.rb, line 17 def update(elapsed_time) start_celebration unless celebrating? self.celebration_time -= elapsed_time end