Class: TabKeeper::Weekly

Inherits:
Object
  • Object
show all
Defined in:
lib/tab_keeper/weekly.rb

Constant Summary collapse

MINUTE_VALUES =
(0..59)
HOUR_VALUES =
(0..23)
DAY_VALUES =

Order matters here - it must match the ordering used by cron (i.e. 0 = Sunday)

i(sunday monday tuesday wednesday thursday friday saturday)

Instance Method Summary collapse

Constructor Details

#initialize(day: nil, hour: nil, min: 0) ⇒ Weekly

Returns a new instance of Weekly.



8
9
10
11
12
13
# File 'lib/tab_keeper/weekly.rb', line 8

def initialize(day: nil, hour: nil, min: 0)
  @day = day
  @hour = hour
  @min = min
  verify!
end

Instance Method Details

#to_sObject



15
16
17
# File 'lib/tab_keeper/weekly.rb', line 15

def to_s
  "#{min} #{hour} * * #{day_index}"
end