Class: KeeperSecretsManager::Storage::EnvironmentStorage
- Inherits:
-
Object
- Object
- KeeperSecretsManager::Storage::EnvironmentStorage
- Includes:
- KeyValueStorage
- Defined in:
- lib/keeper_secrets_manager/storage.rb
Overview
Environment-based storage (read-only)
Instance Method Summary collapse
- #delete(_key) ⇒ Object
- #get_string(key) ⇒ Object
-
#initialize(prefix = 'KSM_') ⇒ EnvironmentStorage
constructor
A new instance of EnvironmentStorage.
- #save_string(_key, _value) ⇒ Object
Methods included from KeyValueStorage
#contains?, #get_bytes, #save_bytes
Constructor Details
#initialize(prefix = 'KSM_') ⇒ EnvironmentStorage
Returns a new instance of EnvironmentStorage.
182 183 184 |
# File 'lib/keeper_secrets_manager/storage.rb', line 182 def initialize(prefix = 'KSM_') @prefix = prefix end |
Instance Method Details
#delete(_key) ⇒ Object
194 195 196 |
# File 'lib/keeper_secrets_manager/storage.rb', line 194 def delete(_key) raise Error, 'Environment storage is read-only' end |
#get_string(key) ⇒ Object
186 187 188 |
# File 'lib/keeper_secrets_manager/storage.rb', line 186 def get_string(key) ENV["#{@prefix}#{key.to_s.upcase}"] end |
#save_string(_key, _value) ⇒ Object
190 191 192 |
# File 'lib/keeper_secrets_manager/storage.rb', line 190 def save_string(_key, _value) raise Error, 'Environment storage is read-only' end |