Class: DTK::Network::Client::Storage::Adapter::S3

Inherits:
Object
  • Object
show all
Defined in:
lib/client/storage/adapters/s3.rb

Instance Method Summary collapse

Constructor Details

#initialize(data_hash) ⇒ S3

Returns a new instance of S3.



7
8
9
# File 'lib/client/storage/adapters/s3.rb', line 7

def initialize(data_hash)
  @s3 = Aws::S3::Client.new(data_hash)
end

Instance Method Details

#delete(data_hash, opts = {}) ⇒ Object



19
20
21
# File 'lib/client/storage/adapters/s3.rb', line 19

def delete(data_hash, opts = {})
  @s3.delete_object(data_hash, opts)
end

#download(data_hash, opts = {}) ⇒ Object



15
16
17
# File 'lib/client/storage/adapters/s3.rb', line 15

def download(data_hash, opts = {})
  @s3.get_object(data_hash, opts)
end

#upload(data_hash) ⇒ Object



11
12
13
# File 'lib/client/storage/adapters/s3.rb', line 11

def upload(data_hash)
  @s3.put_object(data_hash)
end