Class: Wright::Resource::File
- Inherits:
-
Wright::Resource
- Object
- Wright::Resource
- Wright::Resource::File
- 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
The file’s intended group.
-
#mode ⇒ String, Integer
The file’s intended mode.
-
#owner ⇒ String
The file’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
#initialize(name) ⇒ File
Initializes a File.
28 29 30 31 32 33 34 35 |
# File 'lib/wright/resource/file.rb', line 28 def initialize(name) super @content = nil @mode = nil @owner = nil @group = nil @action = :create end |
Instance Attribute Details
#content ⇒ String
Returns the file’s intended content.
14 15 16 |
# File 'lib/wright/resource/file.rb', line 14 def content @content end |
#group ⇒ String
Returns the file’s intended group.
17 18 19 |
# File 'lib/wright/resource/file.rb', line 17 def group @group end |
#mode ⇒ String, Integer
Returns the file’s intended mode.
20 21 22 |
# File 'lib/wright/resource/file.rb', line 20 def mode @mode end |
#owner ⇒ String
Returns the file’s intended owner.
23 24 25 |
# File 'lib/wright/resource/file.rb', line 23 def owner @owner end |
Instance Method Details
#create ⇒ Bool
Creates or updates the file.
49 50 51 52 53 |
# File 'lib/wright/resource/file.rb', line 49 def create might_update_resource do @provider.create end end |
#remove ⇒ Bool
Removes the file.
59 60 61 62 63 |
# File 'lib/wright/resource/file.rb', line 59 def remove might_update_resource do @provider.remove end end |