Module: Schedule::Wmin
- Defined in:
- lib/abstractivator/schedule/schedule.rb
Overview
a ‘wmin’ is a week-minute: a time in any given week, represented as the number of minutes since midnight on Sunday. Saturday 23:59 is the largest wmin (7 * 24 * 60 - 1)
Constant Summary collapse
- DAY =
24 * 60
- WEEK =
7 * DAY
Class Method Summary collapse
- .add_day(wmin) ⇒ Object
- .from_localtime(localtime) ⇒ Object
- .make(day, hour, minute) ⇒ Object
- .parse(day_char, hour, min) ⇒ Object
Class Method Details
.add_day(wmin) ⇒ Object
99 100 101 |
# File 'lib/abstractivator/schedule/schedule.rb', line 99 def self.add_day(wmin) wmin + DAY end |
.from_localtime(localtime) ⇒ Object
95 96 97 |
# File 'lib/abstractivator/schedule/schedule.rb', line 95 def self.from_localtime(localtime) make(localtime.wday, localtime.hour, localtime.min) end |
.make(day, hour, minute) ⇒ Object
91 92 93 |
# File 'lib/abstractivator/schedule/schedule.rb', line 91 def self.make(day, hour, minute) minute + hour * 60 + day * 24 * 60 end |