Sha256: 0934660fdf0c72577c370d3bc69ee4d251bd8667caeaab30584c37cf09ed4fd5
Contents?: true
Size: 657 Bytes
Versions: 11
Compression:
Stored size: 657 Bytes
Contents
# frozen_string_literal: true module PgEventstore module Commands module EventModifiers # Defines how to transform regular event into a link event # @!visibility private class PrepareLinkEvent class << self # @param event [PgEventstore::Event] # @param revision [Integer] # @return [PgEventstore::Event] def call(event, revision) Event.new(link_id: event.id, type: Event::LINK_TYPE, stream_revision: revision).tap do |e| %i[link_id type stream_revision].each { |attr| e.readonly!(attr) } end end end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems