lib/rufus/sc/jobs.rb in rufus-scheduler-2.0.0 vs lib/rufus/sc/jobs.rb in rufus-scheduler-2.0.1
- old
+ new
@@ -199,10 +199,17 @@
def determine_at
@at = Rufus.at_to_f(@t)
end
+
+ # Returns the next time (or the unique time) this job is meant to trigger
+ #
+ def next_time
+
+ Time.at(@at)
+ end
end
#
# Job that occurs once, in a certain amount of time.
#
@@ -323,9 +330,16 @@
end
def trigger_if_matches (time)
trigger(time) if @cron_line.matches?(time)
+ end
+
+ # Returns the next time this job is meant to trigger
+ #
+ def next_time (from=Time.now)
+
+ @cron_line.next_time(from)
end
protected
def determine_at