Class: Synapse::Command::CommandMessage
- Defined in:
- lib/synapse/command/message.rb
Overview
Represents an intent to change application state
Instance Attribute Summary
Attributes inherited from Message
Class Method Summary collapse
-
.as_message(command) ⇒ CommandMessage
Creates a command message using the given command object.
- .builder ⇒ Class
Methods inherited from Message
#and_metadata, build, #initialize, #payload_type, #with_metadata
Constructor Details
This class inherits a constructor from Synapse::Message
Class Method Details
.as_message(command) ⇒ CommandMessage
Creates a command message using the given command object
If the given object is an command message, it will be returned unchanged.
16 17 18 19 20 21 22 23 24 |
# File 'lib/synapse/command/message.rb', line 16 def self.(command) unless command.is_a? CommandMessage command = self.build do |builder| builder.payload = command end end command end |
.builder ⇒ Class
6 7 8 |
# File 'lib/synapse/command/message.rb', line 6 def self.builder CommandMessageBuilder end |