Module: Taskmaster::Henchman::ClassMethods
- Defined in:
- lib/taskmaster/henchman.rb
Instance Method Summary collapse
- #cron_output ⇒ Object
- #every(frequency, options = {}) ⇒ Object
- #run ⇒ Object
- #scheduled_jobs ⇒ Object
Instance Method Details
#cron_output ⇒ Object
30 31 32 |
# File 'lib/taskmaster/henchman.rb', line 30 def cron_output Whenever::JobList.new(@scheduled_jobs.join("\n")).generate_cron_output end |
#every(frequency, options = {}) ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/taskmaster/henchman.rb', line 17 def every(frequency, = {}) @scheduled_jobs ||= [] method = .delete(:run) || :run command = .delete(:command) || :runner @scheduled_jobs << "every #{frequency.to_s}, #{options.inspect} do #{command.to_s} \'#{self.name}.#{method.to_s}\' end" end |
#run ⇒ Object
26 27 28 |
# File 'lib/taskmaster/henchman.rb', line 26 def run raise 'Not implemented' end |
#scheduled_jobs ⇒ Object
34 35 36 |
# File 'lib/taskmaster/henchman.rb', line 34 def scheduled_jobs @scheduled_jobs end |