Class: Wright::Util::FileOwner Private
- Inherits:
-
Object
- Object
- Wright::Util::FileOwner
- Defined in:
- lib/wright/util/file_owner.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Helper class to support user:group
notation in file owner strings.
Instance Attribute Summary collapse
-
#group ⇒ String, Integer
private
The group’s name or gid.
-
#user ⇒ String, Integer
private
The user’s name or uid.
Instance Method Summary collapse
-
#initialize(user_and_group = nil, group = nil) ⇒ FileOwner
constructor
private
A new instance of FileOwner.
-
#user_and_group=(user_and_group) ⇒ void
private
Sets user and group simultaneously.
Constructor Details
#initialize(user_and_group = nil, group = nil) ⇒ FileOwner
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of FileOwner.
12 13 14 15 |
# File 'lib/wright/util/file_owner.rb', line 12 def initialize(user_and_group = nil, group = nil) self.user_and_group = user_and_group self.group = group if group end |
Instance Attribute Details
#group ⇒ String, Integer
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns the group’s name or gid.
10 11 12 |
# File 'lib/wright/util/file_owner.rb', line 10 def group @group end |
#user ⇒ String, Integer
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns the user’s name or uid.
7 8 9 |
# File 'lib/wright/util/file_owner.rb', line 7 def user @user end |
Instance Method Details
#user_and_group=(user_and_group) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
Sets user and group simultaneously.
44 45 46 47 48 |
# File 'lib/wright/util/file_owner.rb', line 44 def user_and_group=(user_and_group) user, group = split_user_and_group(user_and_group) self.user = user self.group = group if group end |