Class: RsyncCron::Cron
- Inherits:
-
Object
- Object
- RsyncCron::Cron
- Defined in:
- lib/rsync_cron/cron.rb
Constant Summary collapse
- ANY =
"*"
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(mins: nil, hour: nil, day: nil, month: nil, week: nil) ⇒ Cron
constructor
A new instance of Cron.
- #to_s ⇒ Object
Constructor Details
#initialize(mins: nil, hour: nil, day: nil, month: nil, week: nil) ⇒ Cron
Returns a new instance of Cron.
11 12 13 14 15 16 17 |
# File 'lib/rsync_cron/cron.rb', line 11 def initialize(mins: nil, hour: nil, day: nil, month: nil, week: nil) @mins = mins.to_a @hour = hour @day = day @month = month @week = week end |
Class Method Details
.factory(s) ⇒ Object
5 6 7 8 9 |
# File 'lib/rsync_cron/cron.rb', line 5 def self.factory(s) mins, hour, day, month, week = s.split(" ") mins = mins.split(",") new(mins: mins, hour: hour, day: day, month: month, week: week) end |
Instance Method Details
#to_s ⇒ Object
19 20 21 |
# File 'lib/rsync_cron/cron.rb', line 19 def to_s "#{mins} #{hour} #{day} #{month} #{week}" end |