Class: Couchbase::Options::Base

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

Overview

Base class for most of the options

Direct Known Subclasses

Management::Options::Analytics::ConnectLink, Management::Options::Analytics::CreateDataset, Management::Options::Analytics::CreateDataverse, Management::Options::Analytics::CreateIndex, Management::Options::Analytics::CreateLink, Management::Options::Analytics::DisconnectLink, Management::Options::Analytics::DropDataset, Management::Options::Analytics::DropDataverse, Management::Options::Analytics::DropIndex, Management::Options::Analytics::DropLink, Management::Options::Analytics::GetAllDatasets, Management::Options::Analytics::GetAllIndexes, Management::Options::Analytics::GetLinks, Management::Options::Analytics::GetPendingMutations, Management::Options::Analytics::ReplaceLink, Management::Options::Bucket::CreateBucket, Management::Options::Bucket::DropBucket, Management::Options::Bucket::FlushBucket, Management::Options::Bucket::GetAllBuckets, Management::Options::Bucket::GetBucket, Management::Options::Bucket::UpdateBucket, Management::Options::Collection::CreateCollection, Management::Options::Collection::CreateScope, Management::Options::Collection::DropCollection, Management::Options::Collection::DropScope, Management::Options::Collection::GetAllScopes, Management::Options::Query::BuildDeferredIndexes, Management::Options::Query::CreateIndex, Management::Options::Query::CreatePrimaryIndex, Management::Options::Query::DropIndex, Management::Options::Query::DropPrimaryIndex, Management::Options::Query::GetAllIndexes, Management::Options::Query::WatchIndexes, Analytics, Append, Decrement, Exists, Get, GetAllReplicas, GetAndLock, GetAndTouch, GetAnyReplica, GetMulti, Increment, Insert, LookupIn, MutateIn, Prepend, Query, Remove, RemoveMulti, Replace, Search, Touch, Unlock, Upsert, UpsertMulti, View

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