Add basic Period class

This commit is contained in:
Dzmitry Plashchynski
2015-03-01 16:06:10 +02:00
parent ab9285ce0b
commit b3a26ba7d3
7 changed files with 39 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
module Periodicity
end
require "active_support/all"
require "periodicity/version.rb"
require "periodicity/period.rb"
require "periodicity/rails.rb"

View File

@@ -1,7 +1,8 @@
module Periodicity
module Extensions
class ActiveJob
def perform_every(period, *args)
def self.perform_every(period, *args)
@period = period
end
end
end

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

@@ -0,0 +1,11 @@
module Periodicity
class Period
def initialize(period)
@period = period
end
def next
@period.from_now
end
end
end