Class: Precursor::Vault
- Inherits:
-
Object
- Object
- Precursor::Vault
- Defined in:
- lib/vault.rb
Overview
Base class for config vaults
Instance Attribute Summary collapse
-
#store ⇒ Object
readonly
Returns the value of attribute store.
Instance Method Summary collapse
-
#key?(key) ⇒ Boolean
Returns true if the vault has a value for the given key, otherwise false.
-
#load(config_root) ⇒ Object
Loads vault data from the source.
-
#value(key) ⇒ Object|Nil
Returns a value fot the given key, nil if key is not available.
Instance Attribute Details
#store ⇒ Object (readonly)
Returns the value of attribute store.
6 7 8 |
# File 'lib/vault.rb', line 6 def store @store end |
Instance Method Details
#key?(key) ⇒ Boolean
Returns true if the vault has a value for the given key, otherwise false
16 17 18 |
# File 'lib/vault.rb', line 16 def key?(key) store.key?(key) end |
#load(config_root) ⇒ Object
Loads vault data from the source
10 11 12 |
# File 'lib/vault.rb', line 10 def load(config_root) @store = load_store(config_root) end |
#value(key) ⇒ Object|Nil
Returns a value fot the given key, nil if key is not available
22 23 24 |
# File 'lib/vault.rb', line 22 def value(key) store[key] end |