Class: Construqt::Users
- Inherits:
-
Object
- Object
- Construqt::Users
- Defined in:
- lib/construqt/users.rb
Instance Method Summary collapse
- #add(name, cfg) ⇒ Object
- #all ⇒ Object
-
#initialize(region) ⇒ Users
constructor
A new instance of Users.
Constructor Details
#initialize(region) ⇒ Users
Returns a new instance of Users.
3 4 5 6 |
# File 'lib/construqt/users.rb', line 3 def initialize(region) @region = region @users = {} end |
Instance Method Details
#add(name, cfg) ⇒ Object
8 9 10 11 12 13 |
# File 'lib/construqt/users.rb', line 8 def add(name, cfg) throw "user exists #{name}" if @users[name] cfg['name'] = name cfg['yubikey'] ||= nil @users[name] = OpenStruct.new(cfg) end |
#all ⇒ Object
15 16 17 |
# File 'lib/construqt/users.rb', line 15 def all @users.values end |