Sha256: d15d9cb9a615071919dbe0b933b272684f3c4782a6667781e61ea1f956f5cd0b
Contents?: true
Size: 1.39 KB
Versions: 25
Compression:
Stored size: 1.39 KB
Contents
module ProconBypassMan module RemotePbmAction class ActionUnexpectedError < StandardError; end class NeedPbmVersionError < ActionUnexpectedError; end class BaseAction attr_accessor :pbm_job_uuid # @param [String] pbm_job_uuid def initialize(pbm_job_uuid: ) self.pbm_job_uuid = pbm_job_uuid end # @return [void] def action_content(_args) raise NotImplementedError, nil end # @param [Hash] args # @return [void] def run!(job_args: ) before_action_callback action_content(args: job_args) after_action_callback rescue => e be_failed ProconBypassMan::SendErrorCommand.execute(error: e) end private # @return [void] def before_action_callback; end # @return [void] def after_action_callback; end # @return [void] def be_failed ProconBypassMan::UpdateRemotePbmActionStatusCommand.new(pbm_job_uuid: pbm_job_uuid).execute(to_status: :failed) end # @return [void] def be_in_progress ProconBypassMan::UpdateRemotePbmActionStatusCommand.new(pbm_job_uuid: pbm_job_uuid).execute(to_status: :in_progress) end # @return [void] def be_processed ProconBypassMan::UpdateRemotePbmActionStatusCommand.new(pbm_job_uuid: pbm_job_uuid).execute(to_status: :processed) end end end end
Version data entries
25 entries across 25 versions & 1 rubygems