Class: Cline::ScheduledJob
- Inherits:
-
Object
- Object
- Cline::ScheduledJob
- Defined in:
- lib/cline/scheduled_job.rb
Constant Summary collapse
- INTERVAL =
60
Instance Method Summary collapse
-
#initialize(trigger, &block) ⇒ ScheduledJob
constructor
A new instance of ScheduledJob.
- #run ⇒ Object
Constructor Details
#initialize(trigger, &block) ⇒ ScheduledJob
Returns a new instance of ScheduledJob.
5 6 7 8 |
# File 'lib/cline/scheduled_job.rb', line 5 def initialize(trigger, &block) @trigger = trigger @job = block end |
Instance Method Details
#run ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/cline/scheduled_job.rb', line 10 def run loop do invoke_if_needed sleep INTERVAL end end |