Sha256: 664d171cc56e9165d1318f25a5d99a2f9c7ec1d39e9c46b067f09612f1b15c87
Contents?: true
Size: 883 Bytes
Versions: 3
Compression:
Stored size: 883 Bytes
Contents
# frozen_string_literal: true # # Copyright (c) 2020-present, Blue Marble Payroll, LLC # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # module Burner # A wrapper to execute a job (in the context of a Pipeline.) class Step extend Forwardable SEPARATOR = '::' private_constant :SEPARATOR attr_reader :job def_delegators :job, :name def initialize(job) raise ArgumentError, 'job is required' unless job @job = job freeze end def perform(output, payload) return_value = nil output.title("#{job.class.name}#{SEPARATOR}#{job.name}") time_in_seconds = Benchmark.measure do return_value = job.perform(output, payload) end.real.round(3) output.complete(time_in_seconds) return_value end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
burner-1.0.0.pre.alpha.6 | lib/burner/step.rb |
burner-1.0.0.pre.alpha.5 | lib/burner/step.rb |
burner-1.0.0.pre.alpha.4 | lib/burner/step.rb |