Class: SecureCredentials::EncryptedFile
- Inherits:
-
ActiveSupport::EncryptedFile
- Object
- ActiveSupport::EncryptedFile
- SecureCredentials::EncryptedFile
- Defined in:
- lib/secure_credentials/encrypted_file.rb
Overview
Wraps ActiveSupport::EncryptedFile to accept key as an argument.
Constant Summary
Constants inherited from ActiveSupport::EncryptedFile
ActiveSupport::EncryptedFile::CIPHER
Instance Attribute Summary
Attributes inherited from ActiveSupport::EncryptedFile
#content_path, #env_key, #key_path, #raise_if_missing_key
Instance Method Summary collapse
-
#initialize(key: nil, key_path: nil, env_key: nil, **options) ⇒ EncryptedFile
constructor
A new instance of EncryptedFile.
- #key ⇒ Object
Methods inherited from ActiveSupport::EncryptedFile
#change, generate_key, #read, #write
Constructor Details
#initialize(key: nil, key_path: nil, env_key: nil, **options) ⇒ EncryptedFile
Returns a new instance of EncryptedFile.
11 12 13 14 15 16 17 18 |
# File 'lib/secure_credentials/encrypted_file.rb', line 11 def initialize(key: nil, key_path: nil, env_key: nil, **) @key = key super( **, env_key: env_key, key_path: key_path || key && '' # original implementation does not accept nil ) end |
Instance Method Details
#key ⇒ Object
20 21 22 |
# File 'lib/secure_credentials/encrypted_file.rb', line 20 def key @key || super end |