Module: Outbox::MessageTypes
- Included in:
- Message
- Defined in:
- lib/outbox/message_types.rb
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
Instance Method Summary collapse
-
#assign_message_type_values(values) ⇒ Object
Assign the given hash where each key is a message type and the value is a hash of options for that message type.
-
#each_message_type ⇒ Object
Loops through each registered message type and yields the instance of that type on this message.
Class Method Details
.included(base) ⇒ Object
3 4 5 6 |
# File 'lib/outbox/message_types.rb', line 3 def self.included(base) base.extend Outbox::DefineInheritableMethod base.extend ClassMethods end |
Instance Method Details
#assign_message_type_values(values) ⇒ Object
Assign the given hash where each key is a message type and the value is a hash of options for that message type.
101 102 103 104 105 |
# File 'lib/outbox/message_types.rb', line 101 def (values) values.each do |key, value| public_send(key, value) if respond_to?(key) end end |
#each_message_type ⇒ Object
Loops through each registered message type and yields the instance of that type on this message.
109 110 111 112 113 |
# File 'lib/outbox/message_types.rb', line 109 def self.class..each_key do || yield , public_send() end end |