Add PerformerProxy

This commit is contained in:
Dzmitry Plashchynski
2015-03-02 22:03:18 +02:00
parent 2fd061a523
commit 6b185c44ac
4 changed files with 29 additions and 1 deletions

View File

@@ -0,0 +1,15 @@
module Periodicity
class PerformerProxy
def initialize(performer)
@performer = performer
end
def every(period, *args)
Config.instance.schedule += [@performer, Period.new(period, *args)]
end
end
def self.perform(performer)
PerformerProxy.new(performer)
end
end