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

Version Path
pg_eventstore-0.10.2 lib/pg_eventstore/commands/event_modifiers/prepare_link_event.rb
pg_eventstore-0.10.1 lib/pg_eventstore/commands/event_modifiers/prepare_link_event.rb
pg_eventstore-0.9.0 lib/pg_eventstore/commands/event_modifiers/prepare_link_event.rb
pg_eventstore-0.8.0 lib/pg_eventstore/commands/event_modifiers/prepare_link_event.rb
pg_eventstore-0.7.2 lib/pg_eventstore/commands/event_modifiers/prepare_link_event.rb
pg_eventstore-0.7.1 lib/pg_eventstore/commands/event_modifiers/prepare_link_event.rb
pg_eventstore-0.7.0 lib/pg_eventstore/commands/event_modifiers/prepare_link_event.rb
pg_eventstore-0.6.0 lib/pg_eventstore/commands/event_modifiers/prepare_link_event.rb
pg_eventstore-0.5.3 lib/pg_eventstore/commands/event_modifiers/prepare_link_event.rb
pg_eventstore-0.5.2 lib/pg_eventstore/commands/event_modifiers/prepare_link_event.rb
pg_eventstore-0.5.0 lib/pg_eventstore/commands/event_modifiers/prepare_link_event.rb