Class: Blix::Cli::DirectoryOperation
- Defined in:
- lib/blix/cli/operations/directory.rb
Overview
create a file system directory
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #description ⇒ Object
-
#initialize(path) ⇒ DirectoryOperation
constructor
A new instance of DirectoryOperation.
- #run ⇒ Object
- #undo ⇒ Object
Methods inherited from Operation
#describe, describe_all, execute_all, list, new, old_new, #perform, reset!
Constructor Details
#initialize(path) ⇒ DirectoryOperation
Returns a new instance of DirectoryOperation.
9 10 11 |
# File 'lib/blix/cli/operations/directory.rb', line 9 def initialize(path) @path = path end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
7 8 9 |
# File 'lib/blix/cli/operations/directory.rb', line 7 def path @path end |
Instance Method Details
#description ⇒ Object
13 14 15 |
# File 'lib/blix/cli/operations/directory.rb', line 13 def description "create directory #{path}" end |
#run ⇒ Object
17 18 19 |
# File 'lib/blix/cli/operations/directory.rb', line 17 def run Dir.mkdir(path) end |
#undo ⇒ Object
21 22 23 |
# File 'lib/blix/cli/operations/directory.rb', line 21 def undo Dir.rmdir(path) end |