Class: Basquiat::Adapters::BaseMessage
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Basquiat::Adapters::BaseMessage
- Defined in:
- lib/basquiat/adapters/base_message.rb
Overview
The simplest Message class. It’s encouraged to tailor it to your adapter needs (hence BaseMessage).
Direct Known Subclasses
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
Action Setters collapse
-
#ack ⇒ Object
Sets the action to be taken after processing to be an ack.
-
#nack ⇒ Object
Sets the action to be taken after processing to be an nack / reject.
-
#requeue ⇒ Object
Sets the action to be taken after processing to be a requeue.
Instance Method Summary collapse
-
#initialize(message) ⇒ BaseMessage
constructor
A new instance of BaseMessage.
Constructor Details
#initialize(message) ⇒ BaseMessage
Note:
All unknown messages will be delegated to the resulting Hash
Returns a new instance of BaseMessage.
11 12 13 14 15 |
# File 'lib/basquiat/adapters/base_message.rb', line 11 def initialize() @message = Basquiat::Json.decode() super(@message) @action = :ack end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
7 8 9 |
# File 'lib/basquiat/adapters/base_message.rb', line 7 def action @action end |
Instance Method Details
#ack ⇒ Object
Sets the action to be taken after processing to be an ack. Here just in case as the default is to acknowledge the message.
20 21 22 |
# File 'lib/basquiat/adapters/base_message.rb', line 20 def ack @action = :ack end |
#nack ⇒ Object
Sets the action to be taken after processing to be an nack / reject
25 26 27 |
# File 'lib/basquiat/adapters/base_message.rb', line 25 def nack @action = :nack end |
#requeue ⇒ Object
Sets the action to be taken after processing to be a requeue
30 31 32 |
# File 'lib/basquiat/adapters/base_message.rb', line 30 def requeue @action = :requeue end |