Class: CrystalMQ::Consumer::ConsumerPayload

Inherits:
Object
  • Object
show all
Defined in:
lib/crystalmq.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#channelObject (readonly)

Returns the value of attribute channel.



24
25
26
# File 'lib/crystalmq.rb', line 24

def channel
  @channel
end

#topicObject (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_msgpackObject



30
31
32
# File 'lib/crystalmq.rb', line 30

def to_msgpack
  { "topic" => @topic, "channel" => @channel }.to_msgpack
end