Class: Credo

Inherits:
Object
  • Object
show all
Defined in:
lib/credo.rb,
lib/credo/version.rb

Constant Summary collapse

VERSION =
"1.0.0"

Instance Method Summary collapse

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

Yields:

  • (@username, password_decrypt)


22
23
24
# File 'lib/credo.rb', line 22

def use
  yield @username, password_decrypt
end