Class: OpenWFE::AtJob

Inherits:
Job
  • Object
show all
Defined in:
lib/openwfe/util/scheduler.rb

Overview

An ‘at’ job.

Direct Known Subclasses

EveryJob

Instance Attribute Summary collapse

Attributes inherited from Job

#block, #job_id, #params, #scheduler, #tags

Instance Method Summary collapse

Methods inherited from Job

#has_tag?, #unschedule

Constructor Details

#initialize(scheduler, at, at_id, params, &block) ⇒ AtJob

The constructor.



976
977
978
979
980
# File 'lib/openwfe/util/scheduler.rb', line 976

def initialize (scheduler, at, at_id, params, &block)

    super(scheduler, at_id, params, &block)
    @at = at
end

Instance Attribute Details

#atObject

The float representation (Time.to_f) of the time at which the job should be triggered.



971
972
973
# File 'lib/openwfe/util/scheduler.rb', line 971

def at
  @at
end

Instance Method Details

#schedule_infoObject

Returns the Time instance at which this job is scheduled.



993
994
995
996
# File 'lib/openwfe/util/scheduler.rb', line 993

def schedule_info

    Time.at(@at)
end

#triggerObject

Triggers the job (calls the block)



985
986
987
988
# File 'lib/openwfe/util/scheduler.rb', line 985

def trigger

    @block.call @job_id, @at
end