Class: Deimos::Backends::Test

Inherits:
Base
  • Object
show all
Defined in:
lib/deimos/backends/test.rb

Overview

Backend which saves messages to an in-memory hash.

Class Method Summary collapse

Methods inherited from Base

publish

Class Method Details

.execute(producer_class:, messages:) ⇒ Object



15
16
17
# File 'lib/deimos/backends/test.rb', line 15

def self.execute(producer_class:, messages:)
  self.sent_messages.concat(messages.map(&:to_h))
end

.sent_messagesArray<Hash>

Returns:

  • (Array<Hash>)


9
10
11
# File 'lib/deimos/backends/test.rb', line 9

def sent_messages
  @sent_messages ||= []
end