Class: EventStoreClient::GRPC::Commands::Streams::LinkTo

Inherits:
Command
  • Object
show all
Defined in:
lib/event_store_client/adapters/grpc/commands/streams/link_to.rb

Instance Method Summary collapse

Methods inherited from Command

#connection_options, #initialize, #metadata, #request, #service, use_request, use_service

Constructor Details

This class inherits a constructor from EventStoreClient::GRPC::Commands::Command

Instance Method Details

#call(stream_name, event, options:, &blk) ⇒ Object

See Also:

  • EventStoreClient::GRPC::Commands::Streams::LinkTo.{EventStoreClient{EventStoreClient::GRPC{EventStoreClient::GRPC::Client{EventStoreClient::GRPC::Client#hard_delete_stream}


9
10
11
12
13
14
15
# File 'lib/event_store_client/adapters/grpc/commands/streams/link_to.rb', line 9

def call(stream_name, event, options:, &blk)
  append_cmd = Append.new(config: config, **connection_options)
  link_event = DeserializedEvent.new(
    id: event.id, type: DeserializedEvent::LINK_TYPE, data: event.title
  )
  append_cmd.call(stream_name, link_event, options: options, &blk)
end