Class: ExportMongoS3::Scheduler
- Inherits:
-
Object
- Object
- ExportMongoS3::Scheduler
- Defined in:
- lib/export_mongo_s3/scheduler.rb
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(options = {}) ⇒ Scheduler
constructor
A new instance of Scheduler.
Constructor Details
#initialize(options = {}) ⇒ Scheduler
4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/export_mongo_s3/scheduler.rb', line 4 def initialize( = {}) = if [[:write], [:clear]].compact.length > 1 raise 'cron: Can only write or clear. Choose one.' end unless [:time] =~ /\A[*\-,0-9]+ [*\-,0-9]+ [*\-,0-9]+ [*\-,0-9]+ [*\-,0-6]+\z/ raise 'config.yml: cron_time is not valid' end end |
Instance Method Details
#execute ⇒ Object
16 17 18 |
# File 'lib/export_mongo_s3/scheduler.rb', line 16 def execute write_crontab(updated_crontab) end |