Class: Wright::Resource::Directory
- Inherits:
-
Wright::Resource
- Object
- Wright::Resource
- Wright::Resource::Directory
- Defined in:
- lib/wright/resource/directory.rb
Overview
Instance Attribute Summary collapse
-
#group ⇒ Object
Public: Get the directory’s group.
-
#mode ⇒ Object
Public: Get/Set the directory’s mode.
-
#owner ⇒ Object
Public: Get the directory’s owner.
Attributes inherited from Wright::Resource
#action, #ignore_failure, #name, #resource_name
Instance Method Summary collapse
-
#create ⇒ Object
Public: Create or update the directory.
-
#initialize(name) ⇒ Directory
constructor
Public: Initialize a Directory.
-
#remove ⇒ Object
Public: Remove the directory.
Methods inherited from Wright::Resource
Constructor Details
#initialize(name) ⇒ Directory
Public: Initialize a Directory.
name - The directory’s name.
16 17 18 19 20 21 22 |
# File 'lib/wright/resource/directory.rb', line 16 def initialize(name) super @mode = nil @owner = nil @group = nil @action = :create end |
Instance Attribute Details
#group ⇒ Object
Public: Get the directory’s group.
39 40 41 |
# File 'lib/wright/resource/directory.rb', line 39 def group @group end |
#mode ⇒ Object
Public: Get/Set the directory’s mode.
25 26 27 |
# File 'lib/wright/resource/directory.rb', line 25 def mode @mode end |
#owner ⇒ Object
Public: Get the directory’s owner.
28 29 30 |
# File 'lib/wright/resource/directory.rb', line 28 def owner @owner end |
Instance Method Details
#create ⇒ Object
Public: Create or update the directory.
Returns true if the directory was updated and false otherwise.
49 50 51 52 53 |
# File 'lib/wright/resource/directory.rb', line 49 def create might_update_resource do @provider.create end end |
#remove ⇒ Object
Public: Remove the directory.
Returns true if the directory was updated and false otherwise.
58 59 60 61 62 |
# File 'lib/wright/resource/directory.rb', line 58 def remove might_update_resource do @provider.remove end end |