Class: Synapse::Auditing::CorrelationDataProvider

Inherits:
AuditDataProvider show all
Defined in:
lib/synapse/auditing/correlation_data_provider.rb

Overview

Implementation of an audit provider that attaches a command’s identifier to each event produced as a result of the execution of that command

Instance Method Summary collapse

Constructor Details

#initialize(correlation_key) ⇒ undefined

Parameters:

  • correlation_key (Symbol)


8
9
10
# File 'lib/synapse/auditing/correlation_data_provider.rb', line 8

def initialize(correlation_key)
  @correlation_key = correlation_key
end

Instance Method Details

#provide_data_for(command) ⇒ Hash

Parameters:

  • command (CommandMessage)

Returns:

  • (Hash)


14
15
16
# File 'lib/synapse/auditing/correlation_data_provider.rb', line 14

def provide_data_for(command)
  Hash[@correlation_key, command.id]
end