Class: DTK::Network::Client::Storage
- Inherits:
-
Object
- Object
- DTK::Network::Client::Storage
- Defined in:
- lib/client/storage/adapters/s3.rb,
lib/client/storage.rb
Defined Under Namespace
Modules: Adapter
Instance Attribute Summary collapse
-
#adapter ⇒ Object
readonly
Returns the value of attribute adapter.
Instance Method Summary collapse
- #delete(data, opts = {}) ⇒ Object
- #download(data, opts = {}) ⇒ Object
-
#initialize(adapter, data) ⇒ Storage
constructor
A new instance of Storage.
- #upload(data) ⇒ Object
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
#adapter ⇒ Object (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 |