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
@!attribute context [r]
The logging context @return [Cabin::Context]
@!attribute message [r]
@return [Qurd::Message]
@!attribute context [r]
The logging context @return [Cabin::Context]
@!attribute message [r]
@return [Qurd::Message]
Public Class Methods
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
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
# 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
Run the plugin
# File lib/qurd/action.rb, line 94 def launch qurd_logger!("Override the abstract method #{__method__}") end
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
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