Class: MessageQueue::Message

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#attributesObject (readonly)

Returns the value of attribute attributes.



3
4
5
# File 'lib/message_queue/message.rb', line 3

def attributes
  @attributes
end

#message_idObject (readonly)

Returns the value of attribute message_id.



3
4
5
# File 'lib/message_queue/message.rb', line 3

def message_id
  @message_id
end

#payloadObject (readonly)

Returns the value of attribute payload.



3
4
5
# File 'lib/message_queue/message.rb', line 3

def payload
  @payload
end

#routing_keyObject (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

#timestampObject (readonly)

Returns the value of attribute timestamp.



3
4
5
# File 'lib/message_queue/message.rb', line 3

def timestamp
  @timestamp
end

#typeObject (readonly)

Returns the value of attribute type.



3
4
5
# File 'lib/message_queue/message.rb', line 3

def type
  @type
end