Class: EventQ::QueueMessage
- Inherits:
-
Object
- Object
- EventQ::QueueMessage
- Extended by:
- ClassKit
- Defined in:
- lib/eventq_base/queue_message.rb
Instance Method Summary collapse
-
#initialize ⇒ QueueMessage
constructor
A new instance of QueueMessage.
-
#sign(provider) ⇒ Object
Creates a signature for the message.
Constructor Details
#initialize ⇒ QueueMessage
Returns a new instance of QueueMessage.
14 15 16 17 18 19 |
# File 'lib/eventq_base/queue_message.rb', line 14 def initialize @retry_attempts = 0 @created = Time.now.to_f @id = SecureRandom.uuid @context = {} end |
Instance Method Details
#sign(provider) ⇒ Object
Creates a signature for the message
25 26 27 28 29 |
# File 'lib/eventq_base/queue_message.rb', line 25 def sign(provider) return unless EventQ::Configuration.signature_secret self.signature = provider.write(message: self, secret: EventQ::Configuration.signature_secret) end |