Class: Dilation::Timers::Coarse

Inherits:
Timer
  • Object
show all
Includes:
Celluloid
Defined in:
lib/dilation/timers/coarse.rb

Overview

A Celluloid based timer that is the default for Dilation::Core

See Also:

Author:

Instance Method Summary collapse

Methods inherited from Timer

#initialize, #running?, #tick

Constructor Details

This class inherits a constructor from Dilation::Timers::Timer

Instance Method Details

#startObject

Start this timer, ticking every second



22
23
24
25
# File 'lib/dilation/timers/coarse.rb', line 22

def start
  @timer = every(1) { tick }
  super
end

#stopObject

Stop this timer



16
17
18
19
# File 'lib/dilation/timers/coarse.rb', line 16

def stop
  defined?(@timer) && @timer.cancel
  super
end