From 4fa3219b4a91fe3a3c05b5679f15489cacc24f52 Mon Sep 17 00:00:00 2001 From: Ben Smith Date: Mon, 2 Oct 2017 11:56:54 +0100 Subject: [PATCH] Private helper functions --- lib/event_store_adapter.ex | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/lib/event_store_adapter.ex b/lib/event_store_adapter.ex index 9b19add..ff57b2b 100644 --- a/lib/event_store_adapter.ex +++ b/lib/event_store_adapter.ex @@ -1,8 +1,6 @@ defmodule Commanded.EventStore.Adapters.EventStore do @moduledoc """ - EventStore[1] adapter for Commanded - - [1] https://github.com/slashdotdash/eventstore + [EventStore](https://github.com/slashdotdash/eventstore) adapter for [Commanded](https://github.com/slashdotdash/commanded). """ @behaviour Commanded.EventStore @@ -68,14 +66,11 @@ defmodule Commanded.EventStore.Adapters.EventStore do EventStore.delete_snapshot(source_uuid) end - def to_event_data(%EventData{} = event_data) do + defp to_event_data(%EventData{} = event_data) do struct(EventStore.EventData, Map.from_struct(event_data)) end - @doc """ - Map from an event store recorded event to its Commanded equivalent - """ - def from_recorded_event(%EventStore.RecordedEvent{ + defp from_recorded_event(%EventStore.RecordedEvent{ event_id: event_id, stream_uuid: stream_uuid, stream_version: stream_version, @@ -99,11 +94,11 @@ defmodule Commanded.EventStore.Adapters.EventStore do } end - def to_snapshot_data(%SnapshotData{} = snapshot) do + defp to_snapshot_data(%SnapshotData{} = snapshot) do struct(EventStore.Snapshots.SnapshotData, Map.from_struct(snapshot)) end - def from_snapshot_data(%EventStore.Snapshots.SnapshotData{} = snapshot_data) do + defp from_snapshot_data(%EventStore.Snapshots.SnapshotData{} = snapshot_data) do struct(SnapshotData, Map.from_struct(snapshot_data)) end end