Class: Async::Cron::Schedule::Weekly

Inherits:
Generic
  • Object
show all
Defined in:
lib/async/cron/schedule/weekly.rb

Overview

A schedule that runs once per day, at midnight.

Instance Attribute Summary

Attributes inherited from Generic

#flags

Instance Method Summary collapse

Methods inherited from Generic

#initialize, #invoke, #run, #run_once

Constructor Details

This class inherits a constructor from Async::Cron::Schedule::Generic

Instance Method Details

#increment(time = nil) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/async/cron/schedule/weekly.rb', line 14

def increment(time = nil)
  time = Time.from(time) || Time.now
  
  time.seconds = 0
  time.minutes = 0
  time.hours = 0
  # 0-6, Sunday is zero
  time.weekday = 7
  
  return time.normalize!
end