Class: StellarCoreBackup::Database

Inherits:
Object
  • Object
show all
Includes:
Contracts
Defined in:
lib/stellar-core-backup/database.rb

Direct Known Subclasses

Restore::Database

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Database

Returns a new instance of Database.



10
11
12
13
14
# File 'lib/stellar-core-backup/database.rb', line 10

def initialize(config)
  @config       = config
  @working_dir  = StellarCoreBackup::Utils.create_working_dir(@config.get('working_dir'))
  @dbname       = check_db_connection
end

Instance Attribute Details

#dbnameObject (readonly)

Returns the value of attribute dbname.



7
8
9
# File 'lib/stellar-core-backup/database.rb', line 7

def dbname
  @dbname
end

Instance Method Details

#backupObject



17
18
19
# File 'lib/stellar-core-backup/database.rb', line 17

def backup()
  pg_dump()
end