Class: Backupsss::Backup

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

Overview

A class for delivering a tar to S3

Constant Summary collapse

MAX_FILE_SIZE =

100MB

1024 * 1024 * 100

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config, client) ⇒ Backup

Returns a new instance of Backup.



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

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

Instance Attribute Details

#clientObject (readonly)

Returns the value of attribute client.



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

def client
  @client
end

#configObject (readonly)

Returns the value of attribute config.



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

def config
  @config
end

#filenameObject (readonly)

Returns the value of attribute filename.



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

def filename
  @filename
end

Instance Method Details

#put_file(file) ⇒ Object



16
17
18
# File 'lib/backupsss/backup.rb', line 16

def put_file(file)
  large_file(file) ? multi_upload(file) : single_upload(file)
end