Class: MessageQueue::Message
- Inherits:
-
Object
- Object
- MessageQueue::Message
- Defined in:
- lib/message_queue/message.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#message_id ⇒ Object
readonly
Returns the value of attribute message_id.
-
#payload ⇒ Object
readonly
Returns the value of attribute payload.
-
#routing_key ⇒ Object
readonly
Returns the value of attribute routing_key.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Message
constructor
A new instance of Message.
Constructor Details
#initialize(attributes = {}) ⇒ Message
5 6 7 8 9 10 11 12 |
# File 'lib/message_queue/message.rb', line 5 def initialize(attributes = {}) @attributes = attributes @message_id = attributes[:message_id] @type = attributes[:type] @payload = attributes[:payload] @timestamp = attributes[:timestamp] @routing_key = attributes[:routing_key] end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
3 4 5 |
# File 'lib/message_queue/message.rb', line 3 def attributes @attributes end |
#message_id ⇒ Object (readonly)
Returns the value of attribute message_id.
3 4 5 |
# File 'lib/message_queue/message.rb', line 3 def @message_id end |
#payload ⇒ Object (readonly)
Returns the value of attribute payload.
3 4 5 |
# File 'lib/message_queue/message.rb', line 3 def payload @payload end |
#routing_key ⇒ Object (readonly)
Returns the value of attribute routing_key.
3 4 5 |
# File 'lib/message_queue/message.rb', line 3 def routing_key @routing_key end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
3 4 5 |
# File 'lib/message_queue/message.rb', line 3 def @timestamp end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
3 4 5 |
# File 'lib/message_queue/message.rb', line 3 def type @type end |