Method: Taskmaster::Henchman::ClassMethods#every
- Defined in:
- lib/taskmaster/henchman.rb
#every(frequency, options = {}) ⇒ Object
Declares the cron job using whenever syntax.
24 25 26 27 28 29 30 31 |
# File 'lib/taskmaster/henchman.rb', line 24 def every(frequency, = {}) @scheduled_jobs ||= [] method = .delete(:run) || :run command = .delete(:with) || :runner @scheduled_jobs << "every #{frequency.to_s}, #{.inspect} do #{command.to_s} \'#{self.name}.#{method.to_s}\' end" end |