Sha256: 394b0f684266955e828fa3a72c45fff8bccfc582b22b3c993f4f3581b92ab06c
Contents?: true
Size: 702 Bytes
Versions: 19
Compression:
Stored size: 702 Bytes
Contents
# frozen_string_literal: true module PgEventstore module Commands module EventModifiers # Defines how to transform regular event before appending it to the stream # @!visibility private class PrepareRegularEvent # @param event [PgEventstore::Event] # @param revision [Integer] # @return [PgEventstore::Event] def call(event, revision) event.class.new( id: event.id, data: event.data, metadata: event.metadata, type: event.type, stream_revision: revision ).tap do |e| %i[link_id link_partition_id stream_revision].each { |attr| e.readonly!(attr) } end end end end end end
Version data entries
19 entries across 19 versions & 1 rubygems