Add Schedule

This commit is contained in:
Dzmitry Plashchynski
2015-03-03 15:11:19 +02:00
parent 2c78115ce7
commit 518160d5d9
9 changed files with 38 additions and 7 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ module Crono
def run
load_rails
print_banner
# start_working_loop
start_working_loop
end
private
+1 -1
View File
@@ -5,7 +5,7 @@ module Crono
attr_accessor :schedule
def initialize
self.schedule = []
self.schedule = Schedule.new
end
end
end
+1 -1
View File
@@ -5,7 +5,7 @@ module Crono
end
def every(period, *args)
Config.instance.schedule += [@performer, Period.new(period, *args)]
Config.instance.schedule.add(@performer, Period.new(period, *args))
end
end
+10
View File
@@ -0,0 +1,10 @@
module Crono
class Schedule
def initialize
@schedule = []
end
def add(peformer, period)
end
end
end