Class: Couchbase::Options::Cluster

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

Overview

Options for Cluster.connect

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(authenticator: nil) {|self| ... } ⇒ Cluster

Creates an instance of options for Cluster.connect

Parameters:

Yield Parameters:



1114
1115
1116
1117
# File 'lib/couchbase/options.rb', line 1114

def initialize(authenticator: nil)
  @authenticator = authenticator
  yield self if block_given?
end

Instance Attribute Details

#authenticatorPasswordAuthenticator, CertificateAuthenticator



1107
1108
1109
# File 'lib/couchbase/options.rb', line 1107

def authenticator
  @authenticator
end

Instance Method Details

#authenticate(username, password) ⇒ Object

Parameters:

  • username (String)
  • password (String)


1121
1122
1123
# File 'lib/couchbase/options.rb', line 1121

def authenticate(username, password)
  @authenticator = PasswordAuthenticator.new(username, password)
end