Class: UnixUserManager::File::Shadow

Inherits:
Base
  • Object
show all
Defined in:
lib/unix_user_manager/file/shadow.rb

Instance Attribute Summary

Attributes inherited from Base

#data, #new_records, #source

Instance Method Summary collapse

Methods inherited from Base

#all, #build, #can_add?, #exist?, #initialize

Constructor Details

This class inherits a constructor from UnixUserManager::File::Base

Instance Method Details

#add(name:) ⇒ Object



7
8
9
10
11
12
# File 'lib/unix_user_manager/file/shadow.rb', line 7

def add(name:)
  return false unless can_add?(name)
  @new_records[name] = { id: nil }

  true
end

#build_new_recordsObject



14
15
16
# File 'lib/unix_user_manager/file/shadow.rb', line 14

def build_new_records
  @new_records.map { |name, _| "#{name}:!!:::::::" }.join("\n")
end

#find(*arg) ⇒ Object

Raises:

  • (NotImplementedError)


3
# File 'lib/unix_user_manager/file/shadow.rb', line 3

def find(*arg);       raise NotImplementedError; end

#find_by_id(*arg) ⇒ Object

Raises:

  • (NotImplementedError)


4
# File 'lib/unix_user_manager/file/shadow.rb', line 4

def find_by_id(*arg); raise NotImplementedError; end

#id_exist?(*arg) ⇒ Boolean

Returns:

  • (Boolean)


5
# File 'lib/unix_user_manager/file/shadow.rb', line 5

def id_exist?(*arg);  false end

#ids(*arg) ⇒ Object

Raises:

  • (NotImplementedError)


2
# File 'lib/unix_user_manager/file/shadow.rb', line 2

def ids(*arg);        raise NotImplementedError; end