Class: Yast::ShadowConfigClass
- Inherits:
-
Module
- Object
- Module
- Yast::ShadowConfigClass
- Includes:
- Logger
- Defined in:
- library/general/src/modules/ShadowConfig.rb
Overview
This class allows to access the API to handle login.defs attributes from Perl
Defined Under Namespace
Classes: UnknownAttributeError
Instance Method Summary collapse
-
#fetch(attr) ⇒ String?
Returns an attribute from login.defs configuration.
-
#main ⇒ Object
Module initialization.
-
#reset ⇒ Object
Resets the configuration.
-
#set(attr, value) ⇒ Object
Sets an attribute to login.defs.
-
#write ⇒ Object
Writes the login.defs configuration.
Instance Method Details
#fetch(attr) ⇒ String?
Returns an attribute from login.defs configuration
56 57 58 59 60 |
# File 'library/general/src/modules/ShadowConfig.rb', line 56 def fetch(attr) normalized_attr = attr.to_s.downcase check_attribute(normalized_attr) config.public_send(normalized_attr) end |
#main ⇒ Object
Module initialization
34 35 36 |
# File 'library/general/src/modules/ShadowConfig.rb', line 34 def main textdomain "base" end |
#reset ⇒ Object
Resets the configuration
It forces to read the configuration again discarding the changes.
42 43 44 |
# File 'library/general/src/modules/ShadowConfig.rb', line 42 def reset @config = nil end |
#set(attr, value) ⇒ Object
Sets an attribute to login.defs
69 70 71 72 73 |
# File 'library/general/src/modules/ShadowConfig.rb', line 69 def set(attr, value) normalized_attr = attr.to_s.downcase check_attribute(normalized_attr) config.public_send("#{normalized_attr}=", value) end |
#write ⇒ Object
Writes the login.defs configuration
76 77 78 |
# File 'library/general/src/modules/ShadowConfig.rb', line 76 def write config.save end |