Class: CarrierWave::Storage::TencentCos::File

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

Overview

Subclass or duck-type CarrierWave::SanitizedFile responsible for storing the file to your engine.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ File

Initialize as required.



25
26
27
# File 'lib/carrierwave/storage/tencent_cos.rb', line 25

def initialize(path)
    @path = path
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



22
23
24
# File 'lib/carrierwave/storage/tencent_cos.rb', line 22

def path
  @path
end

Instance Method Details

#deleteObject



37
38
39
# File 'lib/carrierwave/storage/tencent_cos.rb', line 37

def delete
    TencentCosSdk.delete @path
end

#store(new_file) ⇒ Object



29
30
31
# File 'lib/carrierwave/storage/tencent_cos.rb', line 29

def store(new_file)
    TencentCosSdk.put @path, file: new_file.path
end

#urlObject



33
34
35
# File 'lib/carrierwave/storage/tencent_cos.rb', line 33

def url
    TencentCosSdk.url @path
end