Class: Pwwka::TestHandler::Message
- Inherits:
-
Object
- Object
- Pwwka::TestHandler::Message
- Defined in:
- lib/pwwka/test_handler.rb
Overview
Simple class to hold a popped message.
You can either access the message contents directly, or splat it for the most commonly-needed aspects:
delivery_info, payload = @test_handler.
Instance Attribute Summary collapse
-
#delivery_info ⇒ Object
readonly
Returns the value of attribute delivery_info.
-
#payload ⇒ Object
readonly
Returns the value of attribute payload.
-
#properties ⇒ Object
readonly
Returns the value of attribute properties.
Instance Method Summary collapse
-
#initialize(delivery_info, properties, payload) ⇒ Message
constructor
A new instance of Message.
-
#to_ary ⇒ Object
Returns the delivery_info, payload, properties, and raw_payload for splat magic.
Constructor Details
#initialize(delivery_info, properties, payload) ⇒ Message
Returns a new instance of Message.
85 86 87 88 89 90 |
# File 'lib/pwwka/test_handler.rb', line 85 def initialize(delivery_info, properties, payload) @delivery_info = delivery_info @properties = properties @raw_payload = payload @payload = JSON.parse(@raw_payload) end |
Instance Attribute Details
#delivery_info ⇒ Object (readonly)
Returns the value of attribute delivery_info.
84 85 86 |
# File 'lib/pwwka/test_handler.rb', line 84 def delivery_info @delivery_info end |
#payload ⇒ Object (readonly)
Returns the value of attribute payload.
84 85 86 |
# File 'lib/pwwka/test_handler.rb', line 84 def payload @payload end |
#properties ⇒ Object (readonly)
Returns the value of attribute properties.
84 85 86 |
# File 'lib/pwwka/test_handler.rb', line 84 def properties @properties end |
Instance Method Details
#to_ary ⇒ Object
Returns the delivery_info, payload, properties, and raw_payload for splat magic.
94 95 96 |
# File 'lib/pwwka/test_handler.rb', line 94 def to_ary [@delivery_info,@payload,@properties,@raw_payload] end |