Class: FileTransactions::DeleteFileCommand
- Inherits:
-
BaseCommand
- Object
- BaseCommand
- FileTransactions::DeleteFileCommand
- Defined in:
- lib/file_transactions/delete_file_command.rb
Overview
This command supports deleting a file.
When this command has been executed, the file can be restored by calling #undo
Examples
# Pass in the filename name to ::new
cmd1 = DeleteFileCommand.new('some_existing_file')
Instance Attribute Summary collapse
-
#block ⇒ Object
readonly
Returns the value of attribute block.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name) ⇒ DeleteFileCommand
constructor
A new instance of DeleteFileCommand.
Methods inherited from BaseCommand
execute, #execute, #executed?, #failed?, #register, #undo
Constructor Details
#initialize(name) ⇒ DeleteFileCommand
Returns a new instance of DeleteFileCommand.
20 21 22 |
# File 'lib/file_transactions/delete_file_command.rb', line 20 def initialize(name) @name = name end |
Instance Attribute Details
#block ⇒ Object (readonly)
Returns the value of attribute block.
17 18 19 |
# File 'lib/file_transactions/delete_file_command.rb', line 17 def block @block end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
17 18 19 |
# File 'lib/file_transactions/delete_file_command.rb', line 17 def name @name end |