Class: Pwl::Dialog::ConsolePasswordDialog
- Inherits:
-
ConsoleDialog
- Object
- Base
- ConsoleDialog
- Pwl::Dialog::ConsolePasswordDialog
- Defined in:
- lib/pwl/dialog/console.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #get_input ⇒ Object
-
#initialize(prompt = 'Please enter the master password:') ⇒ ConsolePasswordDialog
constructor
A new instance of ConsolePasswordDialog.
Constructor Details
#initialize(prompt = 'Please enter the master password:') ⇒ ConsolePasswordDialog
Returns a new instance of ConsolePasswordDialog.
16 17 18 |
# File 'lib/pwl/dialog/console.rb', line 16 def initialize(prompt = 'Please enter the master password:') super(prompt) end |
Instance Method Details
#get_input ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/pwl/dialog/console.rb', line 20 def get_input begin STDIN.tty? ? @dialog.ask(prompt){|q| q.echo = "*"} : STDIN.read.chomp rescue Interrupt raise Cancelled.new(1) end end |