Method: Credo#initialize
- Defined in:
- lib/credo.rb
#initialize(params) ⇒ Credo
Returns a new instance of Credo.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/credo.rb', line 5 def initialize(params) @params = params @username = @params[:username] password = @params.delete(:password) password ||= case params[:prompt] when :console ask("Enter password: ") { |q| q.echo = false } when :test 'test' end make_key password_encrypt(password) end |