class CarrierWave::Storage::Sharefile::File
Attributes
path[R]
Public Class Methods
new(uploader, config, path, client)
click to toggle source
# File lib/carrierwave/storage/sharefile.rb, line 45 def initialize(uploader, config, path, client) @uploader, @config, @path, @client = uploader, config, path, client end
Public Instance Methods
content_type()
click to toggle source
content_type=(new_content_type)
click to toggle source
delete()
click to toggle source
filename()
click to toggle source
# File lib/carrierwave/storage/sharefile.rb, line 49 def filename Pathname.new(path).basename.to_s end
read()
click to toggle source
retrieve(identifier)
click to toggle source
size()
click to toggle source
store(file)
click to toggle source
Write file to service
Returns¶ ↑
- Boolean
-
true on success or raises error
# File lib/carrierwave/storage/sharefile.rb, line 129 def store(file) sharefile_file = file.to_file @content_type ||= file.content_type root_folder = @config[:sharefile_root] @file = @client.store_document(root_folder, @path, sharefile_file) end