Class: PgExport::Operations::DecryptDump
- Inherits:
-
Object
- Object
- PgExport::Operations::DecryptDump
- Defined in:
- lib/pg_export/operations/decrypt_dump.rb
Instance Method Summary collapse
- #call(dump:) ⇒ Object
-
#initialize(cipher_factory:) ⇒ DecryptDump
constructor
A new instance of DecryptDump.
- #name ⇒ Object
Constructor Details
#initialize(cipher_factory:) ⇒ DecryptDump
Returns a new instance of DecryptDump.
9 10 11 |
# File 'lib/pg_export/operations/decrypt_dump.rb', line 9 def initialize(cipher_factory:) @cipher_factory = cipher_factory end |
Instance Method Details
#call(dump:) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/pg_export/operations/decrypt_dump.rb', line 17 def call(dump:) dump.decrypt(cipher_factory: cipher_factory) ValueObjects::Success.new(dump: dump) rescue OpenSSL::Cipher::CipherError => e ValueObjects::Failure.new(message: "Problem decrypting dump file: #{e}. Try again.") end |
#name ⇒ Object
13 14 15 |
# File 'lib/pg_export/operations/decrypt_dump.rb', line 13 def name :decrypt_dump end |