Class: GovukMessageQueueConsumer::MockMessage
- Defined in:
- lib/govuk_message_queue_consumer/test_helpers/mock_message.rb
Instance Attribute Summary collapse
-
#acked ⇒ Object
(also: #acked?)
readonly
Returns the value of attribute acked.
-
#delivery_info ⇒ Object
readonly
Returns the value of attribute delivery_info.
-
#discarded ⇒ Object
(also: #discarded?)
readonly
Returns the value of attribute discarded.
-
#header ⇒ Object
readonly
Returns the value of attribute header.
-
#payload ⇒ Object
readonly
Returns the value of attribute payload.
-
#retried ⇒ Object
(also: #retried?)
readonly
Returns the value of attribute retried.
Attributes inherited from Message
Instance Method Summary collapse
- #ack ⇒ Object
- #discard ⇒ Object
-
#initialize(payload = {}, headers = {}, delivery_info = {}) ⇒ MockMessage
constructor
A new instance of MockMessage.
- #retry ⇒ Object
Constructor Details
#initialize(payload = {}, headers = {}, delivery_info = {}) ⇒ MockMessage
Returns a new instance of MockMessage.
11 12 13 |
# File 'lib/govuk_message_queue_consumer/test_helpers/mock_message.rb', line 11 def initialize(payload = {}, headers = {}, delivery_info = {}) super(payload, OpenStruct.new(headers), OpenStruct.new(delivery_info)) end |
Instance Attribute Details
#acked ⇒ Object (readonly) Also known as: acked?
Returns the value of attribute acked.
5 6 7 |
# File 'lib/govuk_message_queue_consumer/test_helpers/mock_message.rb', line 5 def acked @acked end |
#delivery_info ⇒ Object (readonly)
Returns the value of attribute delivery_info.
5 6 7 |
# File 'lib/govuk_message_queue_consumer/test_helpers/mock_message.rb', line 5 def delivery_info @delivery_info end |
#discarded ⇒ Object (readonly) Also known as: discarded?
Returns the value of attribute discarded.
5 6 7 |
# File 'lib/govuk_message_queue_consumer/test_helpers/mock_message.rb', line 5 def discarded @discarded end |
#header ⇒ Object (readonly)
Returns the value of attribute header.
5 6 7 |
# File 'lib/govuk_message_queue_consumer/test_helpers/mock_message.rb', line 5 def header @header end |
#payload ⇒ Object (readonly)
Returns the value of attribute payload.
5 6 7 |
# File 'lib/govuk_message_queue_consumer/test_helpers/mock_message.rb', line 5 def payload @payload end |
#retried ⇒ Object (readonly) Also known as: retried?
Returns the value of attribute retried.
5 6 7 |
# File 'lib/govuk_message_queue_consumer/test_helpers/mock_message.rb', line 5 def retried @retried end |
Instance Method Details
#ack ⇒ Object
15 16 17 |
# File 'lib/govuk_message_queue_consumer/test_helpers/mock_message.rb', line 15 def ack @acked = true end |
#discard ⇒ Object
23 24 25 |
# File 'lib/govuk_message_queue_consumer/test_helpers/mock_message.rb', line 23 def discard @discarded = true end |
#retry ⇒ Object
19 20 21 |
# File 'lib/govuk_message_queue_consumer/test_helpers/mock_message.rb', line 19 def retry @retried = true end |