Class: FileManager::S3

Inherits:
Object
  • Object
show all
Defined in:
lib/file_manager/s3.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.delete(file_path:, bucket:) ⇒ Object



10
11
12
# File 'lib/file_manager/s3.rb', line 10

def delete(file_path:, bucket:)
  new(file_path: file_path, bucket: bucket).delete
end

.store(file_path:, file:, bucket:, acl: "private") ⇒ Object



6
7
8
# File 'lib/file_manager/s3.rb', line 6

def store(file_path:, file:, bucket:, acl: "private")
  new(file_path: file_path, file: file, bucket: bucket, acl: acl).store
end

Instance Method Details

#deleteObject



19
20
21
# File 'lib/file_manager/s3.rb', line 19

def delete
  object.delete if @file_path
end

#storeObject



15
16
17
# File 'lib/file_manager/s3.rb', line 15

def store
  object.put({acl: @acl, body: @file})
end