class Slnky::Service::Timer

Public Class Methods

instance() click to toggle source
# File lib/slnky/service/timer.rb, line 11
def instance
  @instance ||= self.new
end
new() click to toggle source
# File lib/slnky/service/timer.rb, line 16
def initialize
  @timers = []
end

Public Instance Methods

add(seconds, method) click to toggle source
# File lib/slnky/service/timer.rb, line 20
def add(seconds, method)
  @timers << Slnky::Service::Periodic.new(seconds, method)
end
each() { |seconds, method| ... } click to toggle source
# File lib/slnky/service/timer.rb, line 28
def each
  @timers.each do |t|
    yield t.seconds, t.method
  end
end
list() click to toggle source
# File lib/slnky/service/timer.rb, line 24
def list
  @timers
end