Class: EventStoreClient::GRPC::Options::Streams::WriteOptions
- Inherits:
-
Object
- Object
- EventStoreClient::GRPC::Options::Streams::WriteOptions
- Defined in:
- lib/event_store_client/adapters/grpc/options/streams/write_options.rb
Instance Method Summary collapse
-
#initialize(stream_name, options) ⇒ WriteOptions
constructor
A new instance of WriteOptions.
-
#request_options ⇒ Hash
See event_store.client.streams.AppendReq.Options for available options.
Constructor Details
#initialize(stream_name, options) ⇒ WriteOptions
Returns a new instance of WriteOptions.
15 16 17 18 |
# File 'lib/event_store_client/adapters/grpc/options/streams/write_options.rb', line 15 def initialize(stream_name, ) @stream_name = stream_name @options = end |
Instance Method Details
#request_options ⇒ Hash
Returns see event_store.client.streams.AppendReq.Options for available options.
21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/event_store_client/adapters/grpc/options/streams/write_options.rb', line 21 def revision_opt = case [:expected_revision] when :any, :no_stream, :stream_exists { [:expected_revision] => EventStore::Client::Empty.new } when Integer { revision: [:expected_revision] } else { any: EventStore::Client::Empty.new } end revision_opt.merge(stream_identifier: { stream_name: stream_name }) end |