Class: CarrierWave::Storage::Dropbox::File
- Inherits:
-
Object
- Object
- CarrierWave::Storage::Dropbox::File
- Includes:
- Utilities::Uri
- Defined in:
- lib/carrierwave/storage/dropbox.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #delete ⇒ Object
-
#initialize(uploader, config, path, client) ⇒ File
constructor
A new instance of File.
- #url ⇒ Object
Constructor Details
#initialize(uploader, config, path, client) ⇒ File
Returns a new instance of File.
49 50 51 |
# File 'lib/carrierwave/storage/dropbox.rb', line 49 def initialize(uploader, config, path, client) @uploader, @config, @path, @client = uploader, config, path, client end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
47 48 49 |
# File 'lib/carrierwave/storage/dropbox.rb', line 47 def path @path end |
Instance Method Details
#delete ⇒ Object
57 58 59 60 61 62 63 64 |
# File 'lib/carrierwave/storage/dropbox.rb', line 57 def delete path = @path path = "/#{path}" if @config[:access_type] == "dropbox" begin @client.file_delete(path) rescue DropboxError end end |
#url ⇒ Object
53 54 55 |
# File 'lib/carrierwave/storage/dropbox.rb', line 53 def url @client.media(@path)["url"] end |