Class: Liri::Manager::Credential

Inherits:
Object
  • Object
show all
Defined in:
lib/manager/credential.rb

Constant Summary collapse

FILE_NAME =
'liri-credentials.yml'

Instance Method Summary collapse

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

#getObject

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