Class: PasswordChanger::Readers::SingleUser

Inherits:
Object
  • Object
show all
Defined in:
lib/password_changer/readers/single_user.rb

Overview

Build data for single User

Instance Method Summary collapse

Instance Method Details

#parse(user, ask_new_password) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/password_changer/readers/single_user.rb', line 6

def parse(user, ask_new_password)
  old_password = ask('Old Password: ') { |q| q.echo = '*' }
  new_password = ask('New Password: ') { |q| q.echo = '*' } if ask_new_password

  {
    name: user,
    old_password: old_password,
    new_password: new_password
  }
end