Class: EventStoreClient::GRPC::Shared::Options::StreamOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/event_store_client/adapters/grpc/shared/options/stream_options.rb

Instance Method Summary collapse

Constructor Details

#initialize(stream_name, options) ⇒ StreamOptions

Returns a new instance of StreamOptions.

Parameters:

  • stream_name (String)
  • options (Hash)

Options Hash (options):

  • :from_revision. (Integer, Symbol)

    If number is provided - it is threaded as starting revision number. Alternatively you can provide :start or :end value to define a stream revision. **Use this option when stream name is a normal stream name**

  • :from_position. (Hash, Symbol)

    If hash is provided - you should supply it with :commit_position and/or :prepare_position keys. Alternatively you can provide :start or :end value to define a stream position. **Use this option when stream name is “$all”**



20
21
22
23
# File 'lib/event_store_client/adapters/grpc/shared/options/stream_options.rb', line 20

def initialize(stream_name, options)
  @stream_name = stream_name
  @options = options
end

Instance Method Details

#request_optionsHash

Returns:

  • (Hash)


26
27
28
# File 'lib/event_store_client/adapters/grpc/shared/options/stream_options.rb', line 26

def request_options
  stream_name == '$all' ? all_stream : stream
end