Class: CarrierWave::Storage::Sharefile

Inherits:
Abstract
  • Object
show all
Defined in:
lib/carrierwave/storage/sharefile.rb

Defined Under Namespace

Classes: File

Instance Method Summary collapse

Instance Method Details

#clientObject



18
19
20
21
22
23
24
# File 'lib/carrierwave/storage/sharefile.rb', line 18

def client
  CarrierWave::Sharefile::Client.new(config[:sharefile_client_id],
                                     config[:sharefile_client_secret], 
                                     config[:sharefile_username], 
                                     config[:sharefile_password],
                                     config[:sharefile_subdomain])
end

#retrieve!(identifier) ⇒ Object



12
13
14
15
16
# File 'lib/carrierwave/storage/sharefile.rb', line 12

def retrieve!(identifier)
  f = CarrierWave::Storage::Sharefile::File.new(uploader, config, uploader.store_path(identifier), client)
  f.retrieve(identifier)
  f
end

#store!(file) ⇒ Object



6
7
8
9
10
# File 'lib/carrierwave/storage/sharefile.rb', line 6

def store!(file)
  f = CarrierWave::Storage::Sharefile::File.new(uploader, config, uploader.store_path, client)
  f.store(file)
  f
end