Class: Mantle::Message
- Inherits:
-
Object
- Object
- Mantle::Message
- Defined in:
- lib/mantle/message.rb,
lib/mantle/testing.rb
Instance Attribute Summary collapse
-
#catch_up ⇒ Object
writeonly
Sets the attribute catch_up.
-
#channel ⇒ Object
readonly
Returns the value of attribute channel.
-
#message_bus ⇒ Object
writeonly
Sets the attribute message_bus.
Instance Method Summary collapse
-
#initialize(channel) ⇒ Message
constructor
A new instance of Message.
- #publish(message) ⇒ Object
Constructor Details
Instance Attribute Details
#catch_up=(value) ⇒ Object
Sets the attribute catch_up
4 5 6 |
# File 'lib/mantle/message.rb', line 4 def catch_up=(value) @catch_up = value end |
#channel ⇒ Object (readonly)
Returns the value of attribute channel.
3 4 5 |
# File 'lib/mantle/message.rb', line 3 def channel @channel end |
#message_bus=(value) ⇒ Object
Sets the attribute message_bus
4 5 6 |
# File 'lib/mantle/message.rb', line 4 def (value) @message_bus = value end |
Instance Method Details
#publish(message) ⇒ Object
12 13 14 15 16 |
# File 'lib/mantle/message.rb', line 12 def publish() = .merge(__MANTLE__: { message_source: whoami }) if whoami .publish(channel, ) catch_up.(channel, ) end |