Class: Subiam::PasswordManager
- Inherits:
-
Object
- Object
- Subiam::PasswordManager
- Includes:
- Logger::Helper
- Defined in:
- lib/subiam/password_manager.rb
Instance Method Summary collapse
- #identify(user, type) ⇒ Object
-
#initialize(output, options = {}) ⇒ PasswordManager
constructor
A new instance of PasswordManager.
- #puts_password(user, type, password) ⇒ Object
Methods included from Logger::Helper
Constructor Details
#initialize(output, options = {}) ⇒ PasswordManager
Returns a new instance of PasswordManager.
4 5 6 7 |
# File 'lib/subiam/password_manager.rb', line 4 def initialize(output, = {}) @output = output @options = end |
Instance Method Details
#identify(user, type) ⇒ Object
9 10 11 12 13 |
# File 'lib/subiam/password_manager.rb', line 9 def identify(user, type) password = mkpasswd puts_password(user, type, password) password end |
#puts_password(user, type, password) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/subiam/password_manager.rb', line 15 def puts_password(user, type, password) log(:info, "User `#{user}` > `#{type}`: put password to `#{@output}`") open_output do |f| f.puts("#{user},#{type},#{password}") end end |