Class: Liri::Manager::Credential
- Inherits:
-
Object
- Object
- Liri::Manager::Credential
- Defined in:
- lib/manager/credential.rb
Constant Summary collapse
- FILE_NAME =
'liri-credentials.yml'
Instance Method Summary collapse
-
#get ⇒ Object
Obtiene ususario y contraseƱa del sistema en el que se ejecuta el programa.
-
#initialize(folder_path) ⇒ Credential
constructor
A new instance of Credential.
Constructor Details
#initialize(folder_path) ⇒ Credential
Returns a new instance of Credential.
7 8 9 10 |
# File 'lib/manager/credential.rb', line 7 def initialize(folder_path) @folder_path = folder_path @file_path = File.join(@folder_path, '/', FILE_NAME) end |
Instance Method Details
#get ⇒ Object
Obtiene ususario y contraseƱa del sistema en el que se ejecuta el programa
13 14 15 16 17 18 19 20 |
# File 'lib/manager/credential.rb', line 13 def get user, password = get_credentials unless user || password user, password = ask_credentials save_credentials(user, password) end return user, password end |