Module: VaultApi::Configuration
- Included in:
- VaultApi
- Defined in:
- lib/vault_api/configuration.rb
Constant Summary collapse
- VALID_OPTIONS_KEYS =
%i[ address token user password env logger ].freeze
- DEFAULT_ADDRESS =
By default use the main api URL.
''
Class Method Summary collapse
-
.extended(base) ⇒ Object
When this module is extended, reset all settings.
Instance Method Summary collapse
-
#configure {|_self| ... } ⇒ Object
Convenience method to allow configuration options to be set in a block.
- #options ⇒ Object
-
#reset ⇒ Object
Reset all configuration settings to default values.
Class Method Details
.extended(base) ⇒ Object
When this module is extended, reset all settings.
35 36 37 |
# File 'lib/vault_api/configuration.rb', line 35 def self.extended(base) base.reset end |
Instance Method Details
#configure {|_self| ... } ⇒ Object
Convenience method to allow configuration options to be set in a block
24 25 26 |
# File 'lib/vault_api/configuration.rb', line 24 def configure yield self end |
#options ⇒ Object
28 29 30 31 32 |
# File 'lib/vault_api/configuration.rb', line 28 def VALID_OPTIONS_KEYS.each_with_object({}) do |key, option| option[key] = send(key) end end |
#reset ⇒ Object
Reset all configuration settings to default values.
40 41 42 43 |
# File 'lib/vault_api/configuration.rb', line 40 def reset self.address = DEFAULT_ADDRESS # self.adapter = DEFAULT_ADAPTER end |