Class: Sys::Group
- Inherits:
-
Object
- Object
- Sys::Group
- Defined in:
- lib/windows/sys/admin.rb
Instance Attribute Summary collapse
-
#caption ⇒ Object
Short description of the object.
-
#description ⇒ Object
Description of the group.
-
#domain ⇒ Object
Name of the Windows domain to which the group account belongs.
-
#gid ⇒ Object
The group ID.
-
#install_date ⇒ Object
Date the group was added.
-
#local ⇒ Object
writeonly
Sets whether or not the group is local (as opposed to global).
-
#members ⇒ Object
An array of members for that group.
-
#name ⇒ Object
Name of the Windows group account on the Group#domain specified.
-
#sid ⇒ Object
Security identifier for this group.
-
#status ⇒ Object
Current status for the group, such as “ok”, “error”, etc.
Instance Method Summary collapse
-
#initialize {|_self| ... } ⇒ Group
constructor
Creates and returns a new Group object.
-
#local? ⇒ Boolean
Returns whether or not the group is a local group.
-
#sid_type ⇒ Object
Returns the type of SID (Security Identifier) as a stringified value.
-
#sid_type=(stype) ⇒ Object
Sets the SID (Security Identifier) type to
stype, which can be one of the following constant values:.
Constructor Details
#initialize {|_self| ... } ⇒ Group
Creates and returns a new Group object. This class encapsulates the information for a group account, whether it be global or local.
Yields self if a block is given.
44 45 46 |
# File 'lib/windows/sys/admin.rb', line 44 def initialize yield self if block_given? end |
Instance Attribute Details
#caption ⇒ Object
Short description of the object.
10 11 12 |
# File 'lib/windows/sys/admin.rb', line 10 def caption @caption end |
#description ⇒ Object
Description of the group.
13 14 15 |
# File 'lib/windows/sys/admin.rb', line 13 def description @description end |
#domain ⇒ Object
Name of the Windows domain to which the group account belongs.
16 17 18 |
# File 'lib/windows/sys/admin.rb', line 16 def domain @domain end |
#gid ⇒ Object
The group ID.
31 32 33 |
# File 'lib/windows/sys/admin.rb', line 31 def gid @gid end |
#install_date ⇒ Object
Date the group was added.
19 20 21 |
# File 'lib/windows/sys/admin.rb', line 19 def install_date @install_date end |
#local=(value) ⇒ Object (writeonly)
Sets whether or not the group is local (as opposed to global).
34 35 36 |
# File 'lib/windows/sys/admin.rb', line 34 def local=(value) @local = value end |
#members ⇒ Object
An array of members for that group. May contain SID’s.
37 38 39 |
# File 'lib/windows/sys/admin.rb', line 37 def members @members end |
#name ⇒ Object
Name of the Windows group account on the Group#domain specified.
22 23 24 |
# File 'lib/windows/sys/admin.rb', line 22 def name @name end |
#sid ⇒ Object
Security identifier for this group.
25 26 27 |
# File 'lib/windows/sys/admin.rb', line 25 def sid @sid end |
#status ⇒ Object
Current status for the group, such as “ok”, “error”, etc.
28 29 30 |
# File 'lib/windows/sys/admin.rb', line 28 def status @status end |
Instance Method Details
#local? ⇒ Boolean
Returns whether or not the group is a local group.
50 51 52 |
# File 'lib/windows/sys/admin.rb', line 50 def local? @local end |
#sid_type ⇒ Object
Returns the type of SID (Security Identifier) as a stringified value.
56 57 58 |
# File 'lib/windows/sys/admin.rb', line 56 def sid_type @sid_type end |
#sid_type=(stype) ⇒ Object
Sets the SID (Security Identifier) type to stype, which can be one of the following constant values:
-
Admin::SidTypeUser
-
Admin::SidTypeGroup
-
Admin::SidTypeDomain
-
Admin::SidTypeAlias
-
Admin::SidTypeWellKnownGroup
-
Admin::SidTypeDeletedAccount
-
Admin::SidTypeInvalid
-
Admin::SidTypeUnknown
-
Admin::SidTypeComputer
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/windows/sys/admin.rb', line 73 def sid_type=(stype) if stype.kind_of?(String) @sid_type = stype.downcase else case stype when Admin::SidTypeUser @sid_type = "user" when Admin::SidTypeGroup @sid_type = "group" when Admin::SidTypeDomain @sid_type = "domain" when Admin::SidTypeAlias @sid_type = "alias" when Admin::SidTypeWellKnownGroup @sid_type = "well_known_group" when Admin::SidTypeDeletedAccount @sid_type = "deleted_account" when Admin::SidTypeInvalid @sid_type = "invalid" when Admin::SidTypeUnknown @sid_type = "unknown" when Admin::SidTypeComputer @sid_type = "computer" else @sid_type = "unknown" end end end |