Class: Pgchief::Prompt::GrantDatabasePrivileges
- Defined in:
- lib/pgchief/prompt/grant_database_privileges.rb
Overview
Class to ask for database names, in order to create it
Instance Attribute Summary
Attributes inherited from Base
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
#ask_for_password ⇒ Object
21 22 23 |
# File 'lib/pgchief/prompt/grant_database_privileges.rb', line 21 def ask_for_password prompt.mask('Password:') end |
#call ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/pgchief/prompt/grant_database_privileges.rb', line 7 def call username = params[0] || select_user password = params[1] || ask_for_password databases = params[2] || prompt.multi_select("Give \"#{username}\" access to database(s):", Pgchief::Database.all) result = Pgchief::Command::DatabasePrivilegesGrant.call(username, password, databases) prompt.say result end |