Class: StellarCoreBackup::Restore::Database
- Includes:
- Contracts
- Defined in:
- lib/stellar-core-backup/restore/database.rb
Instance Attribute Summary collapse
-
#dbname ⇒ Object
readonly
Returns the value of attribute dbname.
Instance Method Summary collapse
-
#initialize(config) ⇒ Database
constructor
A new instance of Database.
- #restore ⇒ Object
Methods inherited from Database
Constructor Details
#initialize(config) ⇒ Database
Returns a new instance of Database.
10 11 12 13 14 15 |
# File 'lib/stellar-core-backup/restore/database.rb', line 10 def initialize(config) @config = config @working_dir = StellarCoreBackup::Utils.create_working_dir(@config.get('working_dir')) @dbname = check_db_connection @cmd = StellarCoreBackup::Cmd.new(@working_dir) end |
Instance Attribute Details
#dbname ⇒ Object (readonly)
Returns the value of attribute dbname.
7 8 9 |
# File 'lib/stellar-core-backup/restore/database.rb', line 7 def dbname @dbname end |
Instance Method Details
#restore ⇒ Object
19 20 21 |
# File 'lib/stellar-core-backup/restore/database.rb', line 19 def restore() puts "info: database restored" if pg_restore() end |