Class: UnixUserManager::Base
- Inherits:
-
Object
- Object
- UnixUserManager::Base
- Defined in:
- lib/unix_user_manager/base.rb
Constant Summary collapse
- DELEGATED_METHODS =
[:ids, :find, :find_by_id, :exist?, :add, :all, :build, :build_new_records].freeze
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
Instance Method Summary collapse
-
#initialize(*args) ⇒ Base
constructor
A new instance of Base.
- #method_missing(method_name, *args, &block) ⇒ Object
Constructor Details
#initialize(*args) ⇒ Base
Returns a new instance of Base.
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
#file ⇒ Object (readonly)
Returns the value of attribute file.
2 3 4 |
# File 'lib/unix_user_manager/base.rb', line 2 def file @file end |