Fix: Next performing time should be related to last performing time

This commit is contained in:
Dzmitry Plashchynski
2015-03-04 18:46:44 +02:00
parent 828488a6bc
commit 78fa0f9dae
3 changed files with 11 additions and 3 deletions

View File

@@ -5,8 +5,9 @@ module Crono
@at_hour, @at_min = parse_at(at) if at
end
def next
@period.from_now.change({hour: @at_hour, min: @at_min}.compact)
def next(since: nil)
since ||= Time.now
@period.since(since).change({hour: @at_hour, min: @at_min}.compact)
end
def parse_at(at)