Class: Pgclone::Restore
- Inherits:
-
Object
- Object
- Pgclone::Restore
- Defined in:
- lib/pgclone.rb
Instance Attribute Summary collapse
-
#appname ⇒ Object
Returns the value of attribute appname.
-
#file ⇒ Object
Returns the value of attribute file.
-
#local_db ⇒ Object
Returns the value of attribute local_db.
-
#owner ⇒ Object
Returns the value of attribute owner.
Instance Method Summary collapse
- #config(key) ⇒ Object
- #go! ⇒ Object
-
#initialize(opts = {}) ⇒ Restore
constructor
A new instance of Restore.
Constructor Details
#initialize(opts = {}) ⇒ Restore
Returns a new instance of Restore.
23 24 25 26 27 28 29 |
# File 'lib/pgclone.rb', line 23 def initialize(opts={}) @appname = opts[:appname] || config(:appname) @owner = opts[:owner] || config(:owner) @local_db = opts[:local_db] || config(:local_db) @file = opts[:file] || config(:file) || 'latest.dump' raise_missing_keys! end |
Instance Attribute Details
#appname ⇒ Object
Returns the value of attribute appname.
22 23 24 |
# File 'lib/pgclone.rb', line 22 def appname @appname end |
#file ⇒ Object
Returns the value of attribute file.
22 23 24 |
# File 'lib/pgclone.rb', line 22 def file @file end |
#local_db ⇒ Object
Returns the value of attribute local_db.
22 23 24 |
# File 'lib/pgclone.rb', line 22 def local_db @local_db end |
#owner ⇒ Object
Returns the value of attribute owner.
22 23 24 |
# File 'lib/pgclone.rb', line 22 def owner @owner end |
Instance Method Details
#config(key) ⇒ Object
31 32 33 |
# File 'lib/pgclone.rb', line 31 def config(key) Pgclone.configuration.send(key) end |
#go! ⇒ Object
35 36 37 38 39 |
# File 'lib/pgclone.rb', line 35 def go! capture_backup grab_dump restore_db end |