Class: Couchbase::Options::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/couchbase/options.rb

Overview

Base class for most of the options

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(timeout: nil, retry_strategy: nil, client_context: nil, parent_span: nil) {|| ... } ⇒ Base

Returns a new instance of Base.

Parameters:

  • timeout (Integer, #in_milliseconds, nil) (defaults to: nil)

    the time in milliseconds allowed for the operation to complete

  • retry_strategy (Proc, nil) (defaults to: nil)

    the custom retry strategy, if set

  • client_context (Hash, nil) (defaults to: nil)

    the client context data, if set

  • parent_span (Span, nil) (defaults to: nil)

    if set holds the parent span, that should be used for this request

Yield Parameters:



33
34
35
36
37
38
39
40
41
42
# File 'lib/couchbase/options.rb', line 33

def initialize(timeout: nil,
               retry_strategy: nil,
               client_context: nil,
               parent_span: nil)
  @timeout = timeout
  @retry_strategy = retry_strategy
  @client_context = client_context
  @parent_span = parent_span
  yield self if block_given?
end

Instance Attribute Details

#client_contextHash?

Returns:

  • (Hash, nil)


24
25
26
# File 'lib/couchbase/options.rb', line 24

def client_context
  @client_context
end

#parent_spanSpan?

Returns:

  • (Span, nil)


25
26
27
# File 'lib/couchbase/options.rb', line 25

def parent_span
  @parent_span
end

#retry_strategyProc?

Returns:

  • (Proc, nil)


23
24
25
# File 'lib/couchbase/options.rb', line 23

def retry_strategy
  @retry_strategy
end

#timeoutInteger, ...

Returns:

  • (Integer, #in_milliseconds, nil)


22
23
24
# File 'lib/couchbase/options.rb', line 22

def timeout
  @timeout
end