class Qurd::Action

Subclass and override {#launch}, {#launch_error}, {#terminate}, {#terminate_error}, and {#test}, optionally override class method {#Qurd::Action.configure} and instance methods {#run_before} and {#run_after} @abstract

Attributes

context[R]

@!attribute context [r]

The logging context
@return [Cabin::Context]

@!attribute message [r]

@return [Qurd::Message]
message[R]

@!attribute context [r]

The logging context
@return [Cabin::Context]

@!attribute message [r]

@return [Qurd::Message]

Public Class Methods

configure(_action) click to toggle source

Optionally configure the plugin @param [String] _action optionally configure, based on the actions launch, launch_error, terminate, terminate_error, or test

# File lib/qurd/action.rb, line 69
def self.configure(_action)
  qurd_logger.debug('Nothing to do')
end
new(message) click to toggle source

Run the plugin for a given {#Qurd::Message} @param [Qurd::Message] message message The message @raise [Qurd::Action::InvalidMessage] If the message is not a

{#Qurd::Message}

@see Qurd::Message

# File lib/qurd/action.rb, line 78
def initialize(message)
  unless message.is_a?(Qurd::Message)
    qurd_logger!("Message is not a Qurd::Message (#{message.class})",
                 Qurd::Action::InvalidMessage)
  end
  @message = message
  @context = message.context
end

Public Instance Methods

inspect() click to toggle source
# File lib/qurd/action.rb, line 108
def inspect
  format('<%s:%x instance_id:%s message_id:%s context:%s>',
         self.class,
         object_id,
         message.instance_id,
         message.message_id,
         context.inspect
  )
end
launch() click to toggle source

Run the plugin

# File lib/qurd/action.rb, line 94
def launch
  qurd_logger!("Override the abstract method #{__method__}")
end
launch_error()
Alias for: launch
run_after() click to toggle source

Executed after the processor runs the plugins for an action @see Qurd::Processor

# File lib/qurd/action.rb, line 104
def run_after
  qurd_logger.debug('Nothing to do')
end
run_before() click to toggle source

Executed before the processor runs the plugins for an action @see Qurd::Processor

# File lib/qurd/action.rb, line 89
def run_before
  qurd_logger.debug('Nothing to do')
end
terminate()
Alias for: launch
terminate_error()
Alias for: launch
test()
Alias for: launch