Class: Pgchief::Prompt::DropDatabase

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

Overview

Class to prompt for which database to drop

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/drop_database.rb', line 7

def call
  database = prompt.select('Which database needs to be dropped?', Pgchief::Database.all)
  result   = Pgchief::Command::DatabaseDrop.call(database)

  prompt.say result
end