Sha256: 91ec2a6ff8d7dd2bed6a15a464d91a730e9d4c3c55a699f73900267aaa29b04e

Contents?: true

Size: 427 Bytes

Versions: 10

Compression:

Stored size: 427 Bytes

Contents

module WorkerRoulette
  module Preprocessor
    def preprocess(work_order, channel)
      return work_order unless preprocessors.any?

      class_name = self.class.name.split(/::/).last

      preprocessors.inject(work_order) do |job, processor_module|
        processor_class = processor_module.const_get(class_name)
        processor = processor_class.new
        processor.process(job, channel)
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
nexia_worker_roulette-0.2.9 lib/worker_roulette/preprocessor.rb
nexia_worker_roulette-0.2.8 lib/worker_roulette/preprocessor.rb
nexia_worker_roulette-0.2.7 lib/worker_roulette/preprocessor.rb
nexia_worker_roulette-0.2.6 lib/worker_roulette/preprocessor.rb
nexia_worker_roulette-0.2.5 lib/worker_roulette/preprocessor.rb
nexia_worker_roulette-0.2.4 lib/worker_roulette/preprocessor.rb
nexia_worker_roulette-0.2.3 lib/worker_roulette/preprocessor.rb
nexia_worker_roulette-0.2.2 lib/worker_roulette/preprocessor.rb
nexia_worker_roulette-0.2.1 lib/worker_roulette/preprocessor.rb
nexia_worker_roulette-0.2.0 lib/worker_roulette/preprocessor.rb