Method: Etcdv3#initialize

Defined in:
lib/etcdv3.rb

#initialize(**options) ⇒ Etcdv3

Returns a new instance of Etcdv3.



32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/etcdv3.rb', line 32

def initialize(**options)
  @options = options
  @timeout = options[:command_timeout] || DEFAULT_TIMEOUT
  @namespace = options[:namespace]
  @conn = ConnectionWrapper.new(
    @timeout,
    *sanitized_endpoints,
    @namespace,
    @options.fetch(:allow_reconnect, true),
  )
  warn "WARNING: `url` is deprecated. Please use `endpoints` instead." if @options.key?(:url)
  authenticate(@options[:user], @options[:password]) if @options.key?(:user)
end