Sha256: f72172ab7abce1954990bcdc9b4749c3bbfb4df2a32fa2f92fc447fb11c84c92

Contents?: true

Size: 565 Bytes

Versions: 4

Compression:

Stored size: 565 Bytes

Contents

# frozen_string_literal: true

module Chequeo
  class ScheduledJob

    attr_accessor :cron, :klass, :options, :jid

    def initialize(cron, klass, options = {})
      @options = options
      @cron = cron
      @klass = klass
      @jid = Digest::SHA1.hexdigest("#{cron.to_s}:#{klass.to_s}:#{options.to_s}")
    end

    def get_klass
      klass  #TODO: Handle if klass is a string
    end

    def generate_job_run_id job_time
      { job_time: _time, job_id: Digest::SHA1.hexdigest("#{cron.to_s}:#{klass.to_s}:#{options.to_s}:#{job_time}") }
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
chequeo-0.2.3.beta lib/chequeo/scheduled_job.rb
chequeo-0.2.2.beta lib/chequeo/scheduled_job.rb
chequeo-0.2.1.beta lib/chequeo/scheduled_job.rb
chequeo-0.2.0.beta lib/chequeo/scheduled_job.rb