Class: Montrose::Frequency::Weekly
- Inherits:
-
Montrose::Frequency
- Object
- Montrose::Frequency
- Montrose::Frequency::Weekly
- Defined in:
- lib/montrose/frequency/weekly.rb
Constant Summary
Constants inherited from Montrose::Frequency
FREQUENCY_KEYS, FREQUENCY_TERMS
Instance Attribute Summary
Attributes inherited from Montrose::Frequency
Instance Method Summary collapse
Methods inherited from Montrose::Frequency
assert, duration_to_frequency_parts, from_options, from_term, #initialize, #matches_interval?, numeric_to_frequency_parts, parse
Methods included from Rule
#advance!, #continue?, included
Constructor Details
This class inherits a constructor from Montrose::Frequency
Instance Method Details
#include?(time) ⇒ Boolean
6 7 8 |
# File 'lib/montrose/frequency/weekly.rb', line 6 def include?(time) (weeks_since_start(time) % @interval).zero? end |
#to_cron ⇒ Object
10 11 12 13 14 |
# File 'lib/montrose/frequency/weekly.rb', line 10 def to_cron raise "Intervals unsupported" unless @interval == 1 "#{@starts.min} #{@starts.hour} * * #{@starts.wday}" end |