Class: UnixUserManager::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/unix_user_manager/base.rb

Direct Known Subclasses

Groups, Users

Constant Summary collapse

DELEGATED_METHODS =
[:ids, :find, :find_by_id, :exist?, :add, :all, :build, :build_new_records].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Base

Returns a new instance of Base.

Raises:

  • (NotImplementedError)


5
6
7
# File 'lib/unix_user_manager/base.rb', line 5

def initialize(*args)
  raise NotImplementedError
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *args, &block) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/unix_user_manager/base.rb', line 9

def method_missing(method_name, *args, &block)
  if DELEGATED_METHODS.include?(method_name)
    file.send method_name, *args, &block
  else
    super
  end
end

Instance Attribute Details

#fileObject (readonly)

Returns the value of attribute file.



2
3
4
# File 'lib/unix_user_manager/base.rb', line 2

def file
  @file
end