Class: Backupsss::Backup

Inherits:
Object
  • Object
show all
Defined in:
lib/backupsss/backup.rb

Overview

A class for delivering a tar to S3

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config, client) ⇒ Backup

Returns a new instance of Backup.



6
7
8
9
10
# File 'lib/backupsss/backup.rb', line 6

def initialize(config, client)
  @config       = config
  @client       = client
  @filename = config[:filename]
end

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



4
5
6
# File 'lib/backupsss/backup.rb', line 4

def client
  @client
end

#configObject (readonly)

Returns the value of attribute config.



4
5
6
# File 'lib/backupsss/backup.rb', line 4

def config
  @config
end

#filenameObject (readonly)

Returns the value of attribute filename.



4
5
6
# File 'lib/backupsss/backup.rb', line 4

def filename
  @filename
end

Instance Method Details

#put_file(file) ⇒ Object



12
13
14
# File 'lib/backupsss/backup.rb', line 12

def put_file(file)
  client.put_object(bucket_opts.merge(body: file))
end