Class: Construqt::Users

Inherits:
Object
  • Object
show all
Defined in:
lib/construqt/users.rb

Instance Method Summary collapse

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

#allObject



15
16
17
# File 'lib/construqt/users.rb', line 15

def all
  @users.values
end