Class: DeleteFile

Inherits:
EdrGenBase show all
Defined in:
lib/edr_gen/delete_file.rb

Constant Summary collapse

ACTIVITY =
"file_changes"

Constants included from YamlLogger

YamlLogger::LOG_DIRECTORY

Instance Method Summary collapse

Methods included from YamlLogger

write

Constructor Details

#initialize(args) ⇒ DeleteFile

Returns a new instance of DeleteFile.



6
7
8
9
10
11
12
13
# File 'lib/edr_gen/delete_file.rb', line 6

def initialize(args)
  @filepath = args[0]
  command   = ["rm #{@filepath}"]

  validate_args

  super(command)
end

Instance Method Details

#callObject



15
16
17
18
19
# File 'lib/edr_gen/delete_file.rb', line 15

def call
  puts "  Attempting to delete file..."
  execute_process
  puts "  File removed: #{@filepath}"
end