Class: Wright::Resource::Group
- Inherits:
-
Wright::Resource
- Object
- Wright::Resource
- Wright::Resource::Group
- Defined in:
- lib/wright/resource/group.rb
Overview
TODO:
Use GnuPasswd provider on all GNU-flavoured systems
Group resource, represents a group.
Instance Attribute Summary collapse
-
#gid ⇒ Integer
The group’s intended group id.
-
#members ⇒ Array<String>
The group’s intended members.
-
#system ⇒ Bool
True if the group should be a system group.
Attributes inherited from Wright::Resource
#action, #ignore_failure, #name, #resource_name
Instance Method Summary collapse
-
#create ⇒ Bool
Creates or updates the group.
-
#initialize(name) ⇒ Group
constructor
Initializes a Group.
-
#remove ⇒ Bool
Removes the group.
Methods inherited from Wright::Resource
Constructor Details
#initialize(name) ⇒ Group
Initializes a Group.
27 28 29 30 31 |
# File 'lib/wright/resource/group.rb', line 27 def initialize(name) super @action = :create @system = false end |
Instance Attribute Details
#gid ⇒ Integer
Returns the group’s intended group id.
18 19 20 |
# File 'lib/wright/resource/group.rb', line 18 def gid @gid end |
#members ⇒ Array<String>
Returns the group’s intended members.
15 16 17 |
# File 'lib/wright/resource/group.rb', line 15 def members @members end |
#system ⇒ Bool
Returns true if the group should be a system group. Ignored if #gid is set.
22 23 24 |
# File 'lib/wright/resource/group.rb', line 22 def system @system end |
Instance Method Details
#create ⇒ Bool
Creates or updates the group.
37 38 39 40 41 |
# File 'lib/wright/resource/group.rb', line 37 def create might_update_resource do @provider.create end end |
#remove ⇒ Bool
Removes the group.
47 48 49 50 51 |
# File 'lib/wright/resource/group.rb', line 47 def remove might_update_resource do @provider.remove end end |