Class: Statistrano::Util::FilePermissions
- Inherits:
-
Object
- Object
- Statistrano::Util::FilePermissions
- Defined in:
- lib/statistrano/util/file_permissions.rb
Instance Attribute Summary collapse
-
#group ⇒ Object
readonly
Returns the value of attribute group.
-
#others ⇒ Object
readonly
Returns the value of attribute others.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Instance Method Summary collapse
-
#initialize(int) ⇒ FilePermissions
constructor
A new instance of FilePermissions.
- #to_chmod ⇒ Object
Constructor Details
#initialize(int) ⇒ FilePermissions
Returns a new instance of FilePermissions.
8 9 10 |
# File 'lib/statistrano/util/file_permissions.rb', line 8 def initialize int @user, @group, @others = int.to_s.chars.to_a end |
Instance Attribute Details
#group ⇒ Object (readonly)
Returns the value of attribute group.
6 7 8 |
# File 'lib/statistrano/util/file_permissions.rb', line 6 def group @group end |
#others ⇒ Object (readonly)
Returns the value of attribute others.
6 7 8 |
# File 'lib/statistrano/util/file_permissions.rb', line 6 def others @others end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
6 7 8 |
# File 'lib/statistrano/util/file_permissions.rb', line 6 def user @user end |
Instance Method Details
#to_chmod ⇒ Object
12 13 14 15 |
# File 'lib/statistrano/util/file_permissions.rb', line 12 def to_chmod Struct.new(:user, :group, :others) .new( chmod_map(user), chmod_map(group), chmod_map(others) ) end |