Class: CrystalMQ::Consumer::ConsumerPayload
- Inherits:
-
Object
- Object
- CrystalMQ::Consumer::ConsumerPayload
- Defined in:
- lib/crystalmq.rb
Instance Attribute Summary collapse
-
#channel ⇒ Object
readonly
Returns the value of attribute channel.
-
#topic ⇒ Object
readonly
Returns the value of attribute topic.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(topic, channel) ⇒ ConsumerPayload
constructor
A new instance of ConsumerPayload.
- #to_msgpack ⇒ Object
Constructor Details
#initialize(topic, channel) ⇒ ConsumerPayload
Returns a new instance of ConsumerPayload.
25 26 27 28 |
# File 'lib/crystalmq.rb', line 25 def initialize(topic, channel) @topic = topic @channel = channel end |
Instance Attribute Details
#channel ⇒ Object (readonly)
Returns the value of attribute channel.
24 25 26 |
# File 'lib/crystalmq.rb', line 24 def channel @channel end |
#topic ⇒ Object (readonly)
Returns the value of attribute topic.
24 25 26 |
# File 'lib/crystalmq.rb', line 24 def topic @topic end |
Class Method Details
.from_msgpack(h) ⇒ Object
34 35 36 37 |
# File 'lib/crystalmq.rb', line 34 def self.from_msgpack h @topic = h["topic"] @channel = h["channel"] end |
Instance Method Details
#to_msgpack ⇒ Object
30 31 32 |
# File 'lib/crystalmq.rb', line 30 def to_msgpack { "topic" => @topic, "channel" => @channel }.to_msgpack end |