Class: Lyra::EventStoreAdapter

Inherits:
Object
  • Object
show all
Defined in:
lib/lyra/event_store_adapter.rb

Overview

Pluggable event store adapter

Class Method Summary collapse

Class Method Details

.build(backend = nil) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/lyra/event_store_adapter.rb', line 5

def build(backend = nil)
  backend ||= Lyra.config.event_backend

  case backend
  when :rails_event_store, :res
    RailsEventStoreAdapter.new
  when :custom
    CustomEventStoreAdapter.new
  else
    raise "Unknown event backend: #{backend}"
  end
end