add config class and schedule

This commit is contained in:
Dzmitry Plashchynski
2015-03-02 20:28:13 +02:00
parent 6bf168e627
commit 283dd446a3
7 changed files with 41 additions and 2 deletions

View File

@@ -1,4 +1,5 @@
module Periodicity
class Cli
end
end

11
lib/periodicity/config.rb Normal file
View File

@@ -0,0 +1,11 @@
module Periodicity
class Config
include Singleton
attr_accessor :schedule
def initialize
self.schedule = []
end
end
end

View File

@@ -2,7 +2,7 @@ module Periodicity
module Extensions
module ActiveJob
def perform_every(period, *args)
@period = Period.new(period, *args)
Config.instance.schedule += [self, Period.new(period, *args)]
end
end
end