Class: PgExport::Ui::Interactive::Input
- Inherits:
-
Object
- Object
- PgExport::Ui::Interactive::Input
- Defined in:
- lib/pg_export/lib/pg_export/ui/interactive/input.rb
Instance Method Summary collapse
Instance Method Details
#enter_database_name(default = nil) ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/pg_export/lib/pg_export/ui/interactive/input.rb', line 20 def enter_database_name(default = nil) puts 'To which database would you like to restore the downloaded dump?' prompt.ask('Enter a local database name:') do |q| q.required(true) q.default(default) if default end end |
#select_dump(dumps) ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/pg_export/lib/pg_export/ui/interactive/input.rb', line 9 def select_dump(dumps) idx = prompt.select('Select dump to import:') do || .enum '.' dumps.each_with_index do |d, i| .choice(d.to_s, i) end end dumps[idx] end |