Class: Wright::Resource::File
- Inherits:
-
Wright::Resource
- Object
- Wright::Resource
- Wright::Resource::File
- Extended by:
- Forwardable
- Defined in:
- lib/wright/resource/file.rb
Overview
Symlink resource, represents a symlink.
Instance Attribute Summary collapse
-
#content ⇒ String
The file’s intended content.
-
#group ⇒ String, Integer
The directory’s intended group.
-
#mode ⇒ String, Integer
The file’s intended mode.
-
#owner ⇒ String, Integer
The directory’s intended owner.
Attributes inherited from Wright::Resource
#action, #ignore_failure, #name, #resource_name
Instance Method Summary collapse
-
#create ⇒ Bool
Creates or updates the file.
-
#initialize(name) ⇒ File
constructor
Initializes a File.
-
#remove ⇒ Bool
Removes the file.
Methods inherited from Wright::Resource
Constructor Details
Instance Attribute Details
#content ⇒ String
Returns the file’s intended content.
19 20 21 |
# File 'lib/wright/resource/file.rb', line 19 def content @content end |
#group ⇒ String, Integer
Returns the directory’s intended group.
35 |
# File 'lib/wright/resource/file.rb', line 35 def_delegator :@owner, :group= |
#mode ⇒ String, Integer
Returns the file’s intended mode.
22 23 24 |
# File 'lib/wright/resource/file.rb', line 22 def mode @mode end |
#owner ⇒ String, Integer
Returns the directory’s intended owner.
28 |
# File 'lib/wright/resource/file.rb', line 28 def_delegator :@owner, :user_and_group=, :owner= |
Instance Method Details
#create ⇒ Bool
Creates or updates the file.
53 54 55 56 57 |
# File 'lib/wright/resource/file.rb', line 53 def create might_update_resource do @provider.create end end |
#remove ⇒ Bool
Removes the file.
63 64 65 66 67 |
# File 'lib/wright/resource/file.rb', line 63 def remove might_update_resource do @provider.remove end end |