Class: Pgchief::Prompt::BackupDatabase

Inherits:
Base
  • Object
show all
Defined in:
lib/pgchief/prompt/backup_database.rb

Overview

Class to prompt for which database to backup

Instance Attribute Summary

Attributes inherited from Base

#params

Instance Method Summary collapse

Methods inherited from Base

call, #initialize, #klassify, #prompt, #yes_or_no

Constructor Details

This class inherits a constructor from Pgchief::Prompt::Base

Instance Method Details

#callObject



7
8
9
10
11
12
# File 'lib/pgchief/prompt/backup_database.rb', line 7

def call
  database = prompt.select('Which database needs backing up?', Pgchief::Database.all)
  result   = Pgchief::Command::DatabaseBackup.call(database)

  prompt.say result
end