Class: OneSecret::KeyResolution::Stdin
- Inherits:
-
Object
- Object
- OneSecret::KeyResolution::Stdin
- Defined in:
- lib/one_secret/key_resolution.rb
Instance Method Summary collapse
-
#initialize(output = STDOUT, input = STDIN) ⇒ Stdin
constructor
A new instance of Stdin.
- #key ⇒ Object
Constructor Details
#initialize(output = STDOUT, input = STDIN) ⇒ Stdin
Returns a new instance of Stdin.
36 37 38 39 |
# File 'lib/one_secret/key_resolution.rb', line 36 def initialize(output = STDOUT, input = STDIN) @output = output @input = input end |
Instance Method Details
#key ⇒ Object
41 42 43 44 45 46 |
# File 'lib/one_secret/key_resolution.rb', line 41 def key @output.print OneSecret.("Please enter your secret key: ") key = @input.noecho(&:gets).chomp @output.puts key unless key.blank? end |