Class: DTK::Network::Client::Storage

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

Defined Under Namespace

Modules: Adapter

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(adapter, data) ⇒ Storage

Returns a new instance of Storage.



5
6
7
8
# File 'lib/client/storage.rb', line 5

def initialize(adapter, data)
  adapter_clazz = adapter_class(adapter)
  @adapter = adapter_clazz.new(data)
end

Instance Attribute Details

#adapterObject (readonly)

Returns the value of attribute adapter.



3
4
5
# File 'lib/client/storage.rb', line 3

def adapter
  @adapter
end

Instance Method Details

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



18
19
20
# File 'lib/client/storage.rb', line 18

def delete(data, opts = {})
  @adapter.delete(data, opts)
end

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



14
15
16
# File 'lib/client/storage.rb', line 14

def download(data, opts = {})
  @adapter.download(data, opts)
end

#upload(data) ⇒ Object



10
11
12
# File 'lib/client/storage.rb', line 10

def upload(data)
  @adapter.upload(data)
end