Class: Msgr::Message
- Inherits:
-
Object
- Object
- Msgr::Message
- Includes:
- Acknowledge
- Defined in:
- lib/msgr/message.rb,
lib/msgr/message/acknowledge.rb
Defined Under Namespace
Modules: Acknowledge
Instance Attribute Summary collapse
-
#delivery_info ⇒ Object
readonly
Returns the value of attribute delivery_info.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#payload ⇒ Object
readonly
Returns the value of attribute payload.
-
#route ⇒ Object
readonly
Returns the value of attribute route.
Instance Method Summary collapse
- #content_type ⇒ Object
-
#initialize(connection, delivery_info, metadata, payload, route) ⇒ Message
constructor
A new instance of Message.
Methods included from Acknowledge
Constructor Details
#initialize(connection, delivery_info, metadata, payload, route) ⇒ Message
Returns a new instance of Message.
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/msgr/message.rb', line 9 def initialize(connection, delivery_info, , payload, route) @connection = connection @delivery_info = delivery_info = @payload = payload @route = route if content_type == 'application/json' @payload = JSON[payload].symbolize_keys end end |
Instance Attribute Details
#delivery_info ⇒ Object (readonly)
Returns the value of attribute delivery_info.
7 8 9 |
# File 'lib/msgr/message.rb', line 7 def delivery_info @delivery_info end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
7 8 9 |
# File 'lib/msgr/message.rb', line 7 def end |
#payload ⇒ Object (readonly)
Returns the value of attribute payload.
7 8 9 |
# File 'lib/msgr/message.rb', line 7 def payload @payload end |
#route ⇒ Object (readonly)
Returns the value of attribute route.
7 8 9 |
# File 'lib/msgr/message.rb', line 7 def route @route end |
Instance Method Details
#content_type ⇒ Object
21 22 23 |
# File 'lib/msgr/message.rb', line 21 def content_type .content_type end |