Class: Fourchette::Pgbackups

Inherits:
Object
  • Object
show all
Includes:
Logger
Defined in:
lib/fourchette/pgbackups.rb

Instance Method Summary collapse

Methods included from Logger

#logger

Constructor Details

#initializePgbackups

Returns a new instance of Pgbackups.



5
6
7
# File 'lib/fourchette/pgbackups.rb', line 5

def initialize
  @heroku = Fourchette::Heroku.new
end

Instance Method Details

#copy(from, to) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/fourchette/pgbackups.rb', line 9

def copy from, to
  ensure_pgbackups_is_present(from)
  ensure_pgbackups_is_present(to)

  from_url, from_name = pg_details_for(from)
  to_url, to_name = pg_details_for(to)

  @client =  Heroku::Client::Pgbackups.new pgbackup_url(from)+'/api'
  @client.create_transfer(from_url, from_name, to_url, to_name)
end