Class: UnixUserManager::File::Group
- Defined in:
- lib/unix_user_manager/file/group.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
#all, #build, #can_add?, #exist?, #find, #find_by_id, #id_exist?, #ids, #initialize
Constructor Details
This class inherits a constructor from UnixUserManager::File::Base
Instance Method Details
#add(name:, uname:, gid:) ⇒ Object
2 3 4 5 6 7 |
# File 'lib/unix_user_manager/file/group.rb', line 2 def add(name:, uname:, gid:) return false unless can_add?(name, gid) @new_records[name] = { gid: gid, uname: uname } true end |
#build_new_records ⇒ Object
9 10 11 |
# File 'lib/unix_user_manager/file/group.rb', line 9 def build_new_records @new_records.map { |name, data| "#{name}:x:#{data[:gid]}:#{data[:uname]}" }.join("\n") end |