Class: Fclay::RemoteStorage::Base
- Inherits:
-
Object
- Object
- Fclay::RemoteStorage::Base
- Defined in:
- lib/fclay/remote_storage/base.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#options ⇒ Object
Returns the value of attribute options.
-
#storage ⇒ Object
Returns the value of attribute storage.
-
#uploading_object ⇒ Object
Returns the value of attribute uploading_object.
Class Method Summary collapse
Instance Method Summary collapse
- #delete_files ⇒ Object
- #get_storage_by_name(name) ⇒ Object
-
#initialize(name, uploading_object) ⇒ Base
constructor
A new instance of Base.
- #upload(options = {}) ⇒ Object
Constructor Details
#initialize(name, uploading_object) ⇒ Base
Returns a new instance of Base.
5 6 7 8 9 10 |
# File 'lib/fclay/remote_storage/base.rb', line 5 def initialize(name, uploading_object) @name = name @uploading_object = uploading_object @storage = get_storage_by_name(name) @options = @uploading_object.class. end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/fclay/remote_storage/base.rb', line 3 def name @name end |
#options ⇒ Object
Returns the value of attribute options.
3 4 5 |
# File 'lib/fclay/remote_storage/base.rb', line 3 def @options end |
#storage ⇒ Object
Returns the value of attribute storage.
3 4 5 |
# File 'lib/fclay/remote_storage/base.rb', line 3 def storage @storage end |
#uploading_object ⇒ Object
Returns the value of attribute uploading_object.
3 4 5 |
# File 'lib/fclay/remote_storage/base.rb', line 3 def uploading_object @uploading_object end |
Class Method Details
.url(name = nil) ⇒ Object
21 22 |
# File 'lib/fclay/remote_storage/base.rb', line 21 def self.url(name = nil) end |
Instance Method Details
#delete_files ⇒ Object
18 19 |
# File 'lib/fclay/remote_storage/base.rb', line 18 def delete_files end |
#get_storage_by_name(name) ⇒ Object
24 25 26 |
# File 'lib/fclay/remote_storage/base.rb', line 24 def get_storage_by_name(name) Fclay.configuration.remote_storages[name] end |
#upload(options = {}) ⇒ Object
12 13 14 15 16 |
# File 'lib/fclay/remote_storage/base.rb', line 12 def upload( = {}) uploading_object.update(file_status: 'idle', file_location: 'remote') uploading_object.try(:log, "Sucessful uploaded! file_status: 'idle', file_location: #{name}") uploading_object.try(:uploaded) end |