Module: Vault::Configurable

Included in:
Client
Defined in:
lib/vault/configurable.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.keysObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/vault/configurable.rb', line 5

def self.keys
  @keys ||= [
    :address,
    :token,
    :hostname,
    :open_timeout,
    :proxy_address,
    :proxy_password,
    :proxy_port,
    :proxy_username,
    :pool_size,
    :read_timeout,
    :ssl_ciphers,
    :ssl_pem_contents,
    :ssl_pem_file,
    :ssl_pem_passphrase,
    :ssl_ca_cert,
    :ssl_ca_path,
    :ssl_cert_store,
    :ssl_verify,
    :ssl_timeout,
    :timeout,
  ]
end

Instance Method Details

#configure {|self| ... } ⇒ Object

Configure yields self for block-style configuration.

Yields:

  • (self)


35
36
37
# File 'lib/vault/configurable.rb', line 35

def configure
  yield self
end

#optionsHash<Symbol, Object>

The list of options for this configurable.

Returns:

  • (Hash<Symbol, Object>)


42
43
44
45
46
# File 'lib/vault/configurable.rb', line 42

def options
  Hash[*Vault::Configurable.keys.map do |key|
    [key, instance_variable_get(:"@#{key}")]
  end.flatten]
end