module Outbox::MessageTypes

Public Class Methods

included(base) click to toggle source
# File lib/outbox/message_types.rb, line 3
def self.included(base)
  base.extend Outbox::DefineInheritableMethod
  base.extend ClassMethods
end

Public Instance Methods

assign_message_type_values(values) click to toggle source

Assign the given hash where each key is a message type and the value is a hash of options for that message type.

# File lib/outbox/message_types.rb, line 101
def assign_message_type_values(values)
  values.each do |key, value|
    public_send(key, value) if respond_to?(key)
  end
end
each_message_type() { |message_type, public_send(message_type)| ... } click to toggle source

Loops through each registered message type and yields the instance of that type on this message.

# File lib/outbox/message_types.rb, line 109
def each_message_type
  self.class.message_types.each_key do |message_type|
    yield message_type, public_send(message_type)
  end
end