An individual timer set to fire a given proc at a given time
# File lib/timers.rb, line 79 def <=>(other) @time <=> other.time end
Cancel this timer
# File lib/timers.rb, line 84 def cancel @timers.cancel self end
Fire the block
# File lib/timers.rb, line 96 def fire(now = Time.now) reset(now) if recurring @block.call end
Inspect a timer
# File lib/timers.rb, line 103 def inspect str = "#<Timers::Timer:#{object_id.to_s(16)} " now = Time.now if @time if @time >= now str << "fires in #{@time - now} seconds" else str << "fired #{now - @time} seconds ago" end str << ", recurs every #{interval}" if recurring else str << "dead" end str << ">" end
Generated with the Darkfish Rdoc Generator 2.