Class: LogBackupDriver

Inherits:
CloudBackup::Driver show all
Defined in:
lib/drivers/log_backup_driver.rb

Instance Method Summary collapse

Methods inherited from CloudBackup::Driver

#add_file, #list

Constructor Details

#initialize(stream) ⇒ LogBackupDriver

Returns a new instance of LogBackupDriver.



3
4
5
# File 'lib/drivers/log_backup_driver.rb', line 3

def initialize stream
  @stream = stream
end

Instance Method Details

#initiateObject



7
8
9
# File 'lib/drivers/log_backup_driver.rb', line 7

def initiate
  output 'Initiating execution'
end

#list_by_dateObject



11
12
13
14
15
16
17
# File 'lib/drivers/log_backup_driver.rb', line 11

def list_by_date
  output 'Listing driver items by date'
  list.each do |file|
    output "Listing.. file: #{file}"
  end
  @list ||= list
end

#remove(name) ⇒ Object



19
20
21
22
# File 'lib/drivers/log_backup_driver.rb', line 19

def remove name
  @list = @list - [name]
  output "Removing item: #{name}"
end

#terminateObject



30
31
32
# File 'lib/drivers/log_backup_driver.rb', line 30

def terminate
  output 'Terminating execution'
end

#uploadObject



24
25
26
27
28
# File 'lib/drivers/log_backup_driver.rb', line 24

def upload
  list.each do |file|
    output "Uploading.. file: #{file}"
  end
end