Module: S3Browser::Store::StorePlugins::Manager::InstanceMethods

Defined in:
lib/s3browser/plugins/manager.rb

Instance Method Summary collapse

Instance Method Details

#delete(bucket, file) ⇒ Object



18
19
20
21
22
23
# File 'lib/s3browser/plugins/manager.rb', line 18

def delete(bucket, file)
  s3 = Aws::S3::Client.new
  s3.delete_object(bucket: bucket, key: file)

  super(bucket, file)
end

#upload(bucket, file) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/s3browser/plugins/manager.rb', line 8

def upload(bucket, file)
  filename = file[:filename]
  tempfile = file[:tempfile]

  s3 = Aws::S3::Resource.new
  s3.bucket(bucket).object(filename).upload_file(tempfile.path)

  super(bucket, file)
end