Class: ConfidentialInfoManager::YAML
- Defined in:
- lib/confidential_info_manager/yaml.rb
Constant Summary
Constants inherited from Core
Core::ITERATOR_COUNT, Core::RANDOM_BYTES
Instance Method Summary collapse
-
#load(file_path) ⇒ Hash
YAML file load.
-
#save(secret_data, file_path) ⇒ Object
YAML file save.
Methods inherited from Core
#decrypt, #decrypt_only_value, #encrypt, #encrypt_only_value, generate_salt, #initialize
Constructor Details
This class inherits a constructor from ConfidentialInfoManager::Core
Instance Method Details
#load(file_path) ⇒ Hash
YAML file load
20 21 22 |
# File 'lib/confidential_info_manager/yaml.rb', line 20 def load(file_path) decrypt_only_value(::YAML.load(File.read(file_path))) end |
#save(secret_data, file_path) ⇒ Object
YAML file save
12 13 14 |
# File 'lib/confidential_info_manager/yaml.rb', line 12 def save(secret_data, file_path) File.open(file_path, "w") { |file| ::YAML.dump(encrypt_only_value(secret_data), file) } end |