Method: JSONtoDB::CLI.authentication_credentials

Defined in:
lib/jsontodb/cli.rb

.authentication_credentials(user = nil, pass = nil) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/jsontodb/cli.rb', line 11

def authentication_credentials(user = nil, pass = nil)
  if user.nil? || pass.nil?
    puts 'USER AUTHENTICATION'
    puts '==================='
    puts
    print 'Username: '
    @user = STDIN.gets.chomp
    print 'Password: '
    @pass = STDIN.noecho(&:gets).chomp
    puts
    puts
  else
    @user = user
    @pass = pass
  end
end