Class: Pwl::Dialog::ConsolePasswordDialog

Inherits:
ConsoleDialog show all
Defined in:
lib/pwl/dialog/console.rb

Instance Attribute Summary

Attributes inherited from Base

#prompt, #title

Instance Method Summary collapse

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_inputObject



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