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.
181 182 183 |
# File 'lib/keeper_secrets_manager/storage.rb', line 181 def initialize(prefix = 'KSM_') @prefix = prefix end |
Instance Method Details
#delete(_key) ⇒ Object
193 194 195 |
# File 'lib/keeper_secrets_manager/storage.rb', line 193 def delete(_key) raise Error, 'Environment storage is read-only' end |
#get_string(key) ⇒ Object
185 186 187 |
# File 'lib/keeper_secrets_manager/storage.rb', line 185 def get_string(key) ENV["#{@prefix}#{key.to_s.upcase}"] end |
#save_string(_key, _value) ⇒ Object
189 190 191 |
# File 'lib/keeper_secrets_manager/storage.rb', line 189 def save_string(_key, _value) raise Error, 'Environment storage is read-only' end |