Class: Lieutenant::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/lieutenant/config.rb

Overview

Manages configuration

Instance Method Summary collapse

Instance Method Details

#aggregate_repositoryObject



17
18
19
# File 'lib/lieutenant/config.rb', line 17

def aggregate_repository
  @aggregate_repository ||= AggregateRepository.new(event_store)
end

#command_senderObject



21
22
23
# File 'lib/lieutenant/config.rb', line 21

def command_sender
  @command_sender ||= CommandSender.new(aggregate_repository)
end

#event_busObject



6
7
8
# File 'lib/lieutenant/config.rb', line 6

def event_bus
  @event_bus ||= EventBus.new
end

#event_store(implementation = false) ⇒ Object

:reek:BooleanParameter



11
12
13
14
15
# File 'lib/lieutenant/config.rb', line 11

def event_store(implementation = false)
  return @event_store_implementation = implementation if implementation
  @event_store_implementation ||= EventStore::InMemory
  @event_store ||= EventStore.new(@event_store_implementation, event_bus)
end