Class: CarrierWave::Storage::TencentCos::File
- Inherits:
-
Object
- Object
- CarrierWave::Storage::TencentCos::File
- 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
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #delete ⇒ Object
-
#initialize(path) ⇒ File
constructor
Initialize as required.
- #store(new_file) ⇒ Object
- #url ⇒ Object
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
#path ⇒ Object (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
#delete ⇒ Object
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 |
#url ⇒ Object
33 34 35 |
# File 'lib/carrierwave/storage/tencent_cos.rb', line 33 def url TencentCosSdk.url @path end |