Class: Sys::Admin::User
- Inherits:
-
Object
- Object
- Sys::Admin::User
- Defined in:
- lib/sys/admin/common.rb
Overview
The User class encapsulates the information found in /etc/passwd.
Instance Attribute Summary collapse
-
#access_class ⇒ Object
The user’s access class.
-
#age ⇒ Object
Used in the past for password aging.
-
#change ⇒ Object
Next date a password change will be needed.
-
#comment ⇒ Object
Another comment field.
-
#dir ⇒ Object
The absolute path name of the user’s home directory.
-
#expire ⇒ Object
The account’s expiration date.
-
#fields ⇒ Object
TODO: Forgot what this is.
-
#gecos ⇒ Object
A comment field.
-
#gid ⇒ Object
The user’s group ID.
-
#login_device ⇒ Object
The name of the terminal device the user last logged on with.
-
#login_host ⇒ Object
The host name from which the user last logged in.
-
#login_time ⇒ Object
The last time the user logged in.
-
#name ⇒ Object
The user name associated with the account.
-
#passwd ⇒ Object
The user’s encrypted password.
-
#quota ⇒ Object
The user’s alloted amount of disk space.
-
#shell ⇒ Object
The user’s login shell.
-
#uid ⇒ Object
The user’s user ID.
Instance Method Summary collapse
-
#groups ⇒ Object
An array of groups to which the user belongs.
-
#initialize {|_self| ... } ⇒ User
constructor
Creates and returns a User object, which encapsulates the information typically found within an /etc/passwd entry, i.e.
Constructor Details
#initialize {|_self| ... } ⇒ User
Creates and returns a User object, which encapsulates the information typically found within an /etc/passwd entry, i.e. a struct passwd.
If a block is provided, yields the object back to the block.
97 98 99 |
# File 'lib/sys/admin/common.rb', line 97 def initialize yield self if block_given? end |
Instance Attribute Details
#access_class ⇒ Object
The user’s access class.
75 76 77 |
# File 'lib/sys/admin/common.rb', line 75 def access_class @access_class end |
#age ⇒ Object
Used in the past for password aging. Deprecated by /etc/shadow.
81 82 83 |
# File 'lib/sys/admin/common.rb', line 81 def age @age end |
#change ⇒ Object
Next date a password change will be needed.
54 55 56 |
# File 'lib/sys/admin/common.rb', line 54 def change @change end |
#comment ⇒ Object
Another comment field.
78 79 80 |
# File 'lib/sys/admin/common.rb', line 78 def comment @comment end |
#dir ⇒ Object
The absolute path name of the user’s home directory.
63 64 65 |
# File 'lib/sys/admin/common.rb', line 63 def dir @dir end |
#expire ⇒ Object
The account’s expiration date
69 70 71 |
# File 'lib/sys/admin/common.rb', line 69 def expire @expire end |
#fields ⇒ Object
TODO: Forgot what this is.
72 73 74 |
# File 'lib/sys/admin/common.rb', line 72 def fields @fields end |
#gecos ⇒ Object
A comment field. Rarely used now.
57 58 59 |
# File 'lib/sys/admin/common.rb', line 57 def gecos @gecos end |
#gid ⇒ Object
The user’s group ID.
51 52 53 |
# File 'lib/sys/admin/common.rb', line 51 def gid @gid end |
#login_device ⇒ Object
The name of the terminal device the user last logged on with.
90 91 92 |
# File 'lib/sys/admin/common.rb', line 90 def login_device @login_device end |
#login_host ⇒ Object
The host name from which the user last logged in.
87 88 89 |
# File 'lib/sys/admin/common.rb', line 87 def login_host @login_host end |
#login_time ⇒ Object
The last time the user logged in.
84 85 86 |
# File 'lib/sys/admin/common.rb', line 84 def login_time @login_time end |
#name ⇒ Object
The user name associated with the account.
42 43 44 |
# File 'lib/sys/admin/common.rb', line 42 def name @name end |
#passwd ⇒ Object
The user’s encrypted password. Deprecated by /etc/shadow.
45 46 47 |
# File 'lib/sys/admin/common.rb', line 45 def passwd @passwd end |
#quota ⇒ Object
The user’s alloted amount of disk space.
60 61 62 |
# File 'lib/sys/admin/common.rb', line 60 def quota @quota end |
#shell ⇒ Object
The user’s login shell.
66 67 68 |
# File 'lib/sys/admin/common.rb', line 66 def shell @shell end |
#uid ⇒ Object
The user’s user ID.
48 49 50 |
# File 'lib/sys/admin/common.rb', line 48 def uid @uid end |