Class: Yauth::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/yauth/cli.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#managerObject (readonly)

Returns the value of attribute manager.



4
5
6
# File 'lib/yauth/cli.rb', line 4

def manager
  @manager
end

Instance Method Details

#add(username, password) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/yauth/cli.rb', line 8

def add(username, password)
  init_manager
  user = Yauth::User.new
  user.username = username
  user.plain_password = password
  manager.add(user)
  save_manager
end

#rm(username) ⇒ Object



19
20
21
22
23
# File 'lib/yauth/cli.rb', line 19

def rm(username)
  init_manager
  manager.remove(username)
  save_manager
end