Class: Backupsss::Backup
- Inherits:
-
Object
- Object
- Backupsss::Backup
- 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
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
Instance Method Summary collapse
-
#initialize(config, client) ⇒ Backup
constructor
A new instance of Backup.
- #put_file(file) ⇒ Object
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
#client ⇒ Object (readonly)
Returns the value of attribute client.
8 9 10 |
# File 'lib/backupsss/backup.rb', line 8 def client @client end |
#config ⇒ Object (readonly)
Returns the value of attribute config.
8 9 10 |
# File 'lib/backupsss/backup.rb', line 8 def config @config end |
#filename ⇒ Object (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 |