Class: PackerFiles::Core::User
- Defined in:
- lib/PackerFiles/Core/User.rb
Overview
Define the User class that can handle User specified in a Packerfile. Just the barebones attributes that are required for this class are specified here. The conversion of these attributes into a OS build specific file is done by derived classes in the OS specific directories.
Instance Attribute Summary collapse
-
#groups ⇒ Object
Returns the value of attribute groups.
-
#login ⇒ Object
Specify attributes.
-
#name ⇒ Object
Returns the value of attribute name.
-
#password ⇒ Object
Returns the value of attribute password.
-
#uid ⇒ Object
Returns the value of attribute uid.
Class Method Summary collapse
-
.doc_file ⇒ Object
Documentation for this class.
Instance Method Summary collapse
-
#initialize {|_self| ... } ⇒ User
constructor
Constructor to just specify accessor varibales.
-
#normalize ⇒ Object
Normalize the various values into something useful.
Constructor Details
#initialize {|_self| ... } ⇒ User
Constructor to just specify accessor varibales
29 30 31 32 |
# File 'lib/PackerFiles/Core/User.rb', line 29 def initialize @groups = [] yield self if block_given? end |
Instance Attribute Details
#groups ⇒ Object
Returns the value of attribute groups.
21 22 23 |
# File 'lib/PackerFiles/Core/User.rb', line 21 def groups @groups end |
#login ⇒ Object
Specify attributes
17 18 19 |
# File 'lib/PackerFiles/Core/User.rb', line 17 def login @login end |
#name ⇒ Object
Returns the value of attribute name.
18 19 20 |
# File 'lib/PackerFiles/Core/User.rb', line 18 def name @name end |
#password ⇒ Object
Returns the value of attribute password.
19 20 21 |
# File 'lib/PackerFiles/Core/User.rb', line 19 def password @password end |
#uid ⇒ Object
Returns the value of attribute uid.
20 21 22 |
# File 'lib/PackerFiles/Core/User.rb', line 20 def uid @uid end |
Class Method Details
.doc_file ⇒ Object
Documentation for this class
24 25 26 |
# File 'lib/PackerFiles/Core/User.rb', line 24 def self.doc_file PackerFiles.DirPath('Core/example/User.txt').first end |
Instance Method Details
#normalize ⇒ Object
Normalize the various values into something useful. The default implementation checks only errors
36 37 38 39 40 |
# File 'lib/PackerFiles/Core/User.rb', line 36 def normalize raise NilException.new(self, 'login') if @login.nil? raise NilException.new(self, 'name') if @name.nil? raise NilException.new(self, 'password') if @password.nil? end |