Sha256: 74cdef0b2c4ac47cab7c3e517bfc02e8c654438b8c4befb5b02fb66492b13af0

Contents?: true

Size: 735 Bytes

Versions: 9

Compression:

Stored size: 735 Bytes

Contents

require 'rocketjob'
module Jobs
  class TestJob < RocketJob::Job
    @@result = nil

    # For holding test results
    def self.result
      @@result
    end

    def perform(first)
      @@result = first + 1
    end

    def sum(a, b)
      @@result = a + b
    end

    # Test silencing noisy logging
    def noisy_logger
      logger.info 'some very noisy logging'
    end

    # Test increasing log level for debugging purposes
    def debug_logging
      logger.trace 'enable tracing level for just the job instance'
    end

    def before_event(hash)
      hash['before_event'] = true
    end

    def event(hash)
      hash['event'] = true
    end

    def after_event(hash)
      hash['after_event'] = true
    end

  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rocketjob-1.1.3 test/jobs/test_job.rb
rocketjob-1.1.2 test/jobs/test_job.rb
rocketjob-1.1.1 test/jobs/test_job.rb
rocketjob-1.1.0 test/jobs/test_job.rb
rocketjob-1.0.0 test/jobs/test_job.rb
rocketjob-0.9.1 test/jobs/test_job.rb
rocketjob-0.9.0 test/jobs/test_job.rb
rocketjob-0.8.0 test/jobs/test_job.rb
rocketjob-0.7.0 test/jobs/test_job.rb