Module: Wristwatch::Intervals
- Included in:
- Schedule
- Defined in:
- lib/wristwatch/slices.rb,
lib/wristwatch/intervals.rb
Instance Method Summary collapse
- #annually ⇒ Object
- #bi_daily ⇒ Object
- #bi_hourly ⇒ Object
- #bi_monthly ⇒ Object
- #bi_weekly ⇒ Object
- #daily ⇒ Object
- #hourly ⇒ Object
- #monthly ⇒ Object
- #quarter_hourly ⇒ Object
- #quarterly ⇒ Object
- #semiannually ⇒ Object
- #weekly ⇒ Object
Instance Method Details
#annually ⇒ Object
47 48 49 |
# File 'lib/wristwatch/slices.rb', line 47 def annually daily and monthly and now.month.eql?(1) end |
#bi_daily ⇒ Object
15 16 17 |
# File 'lib/wristwatch/slices.rb', line 15 def bi_daily now.hour.divisible_by?(12) end |
#bi_hourly ⇒ Object
7 8 9 |
# File 'lib/wristwatch/slices.rb', line 7 def bi_hourly now.hour.divisible_by?(2) end |
#bi_monthly ⇒ Object
35 36 37 |
# File 'lib/wristwatch/slices.rb', line 35 def bi_monthly daily and monthly and now.month.divisible_by?(2, 1) end |
#bi_weekly ⇒ Object
27 28 29 |
# File 'lib/wristwatch/slices.rb', line 27 def bi_weekly daily and ( now.day.eql?(1) or now.day.eql?(15) ) end |
#daily ⇒ Object
19 20 21 |
# File 'lib/wristwatch/slices.rb', line 19 def daily now.hour.eql?(0) end |
#hourly ⇒ Object
3 4 5 |
# File 'lib/wristwatch/slices.rb', line 3 def hourly true end |
#monthly ⇒ Object
31 32 33 |
# File 'lib/wristwatch/slices.rb', line 31 def monthly daily and now.day.eql?(1) end |
#quarter_hourly ⇒ Object
11 12 13 |
# File 'lib/wristwatch/slices.rb', line 11 def quarter_hourly now.hour.divisible_by?(6) end |
#quarterly ⇒ Object
39 40 41 |
# File 'lib/wristwatch/slices.rb', line 39 def quarterly daily and monthly and now.month.divisible_by?(3, 1) end |
#semiannually ⇒ Object
43 44 45 |
# File 'lib/wristwatch/slices.rb', line 43 def semiannually daily and monthly and now.month.divisible_by?(6, 1) end |
#weekly ⇒ Object
23 24 25 |
# File 'lib/wristwatch/slices.rb', line 23 def weekly daily and now.wday.eql?(0) end |