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



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

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

#command_senderObject



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

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

#event_bus(implementation = false) ⇒ Object

:reek:BooleanParameter



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

def event_bus(implementation = false)
  return @event_bus = implementation if implementation
  @event_bus ||= EventBus::InMemory.new
end

#event_store(implementation = false) ⇒ Object

:reek:BooleanParameter



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

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