Class: CrystalMQ::Producer::ProducerPayload
- Inherits:
-
Object
- Object
- CrystalMQ::Producer::ProducerPayload
- Defined in:
- lib/crystalmq.rb
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#topic ⇒ Object
readonly
Returns the value of attribute topic.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(topic, message) ⇒ ProducerPayload
constructor
A new instance of ProducerPayload.
- #to_msgpack ⇒ Object
Constructor Details
#initialize(topic, message) ⇒ ProducerPayload
Returns a new instance of ProducerPayload.
76 77 78 79 |
# File 'lib/crystalmq.rb', line 76 def initialize(topic, ) @topic = topic @message = end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
74 75 76 |
# File 'lib/crystalmq.rb', line 74 def @message end |
#topic ⇒ Object (readonly)
Returns the value of attribute topic.
74 75 76 |
# File 'lib/crystalmq.rb', line 74 def topic @topic end |
Class Method Details
.from_msgpack(h) ⇒ Object
85 86 87 88 |
# File 'lib/crystalmq.rb', line 85 def self.from_msgpack h @topic = h["topic"] @message = h["message"] end |
Instance Method Details
#to_msgpack ⇒ Object
81 82 83 |
# File 'lib/crystalmq.rb', line 81 def to_msgpack { "topic" => @topic, "message" => @message }.to_msgpack end |