Class: Credo
- Inherits:
-
Object
- Object
- Credo
- Defined in:
- lib/credo.rb,
lib/credo/version.rb
Constant Summary collapse
- VERSION =
"1.0.0"
Instance Method Summary collapse
-
#initialize(params) ⇒ Credo
constructor
A new instance of Credo.
- #use {|@username, password_decrypt| ... } ⇒ Object
Constructor Details
#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 |
Instance Method Details
#use {|@username, password_decrypt| ... } ⇒ Object
22 23 24 |
# File 'lib/credo.rb', line 22 def use yield @username, password_decrypt end |