Class: CarrierWave::Storage::S3cn::File
- Inherits:
-
Object
- Object
- CarrierWave::Storage::S3cn::File
- Defined in:
- lib/carrierwave/s3cn/storage.rb
Instance Method Summary collapse
- #content_type ⇒ Object
- #delete ⇒ Object
- #etag ⇒ Object
-
#initialize(uploader, path) ⇒ File
constructor
A new instance of File.
- #meta ⇒ Object
- #path ⇒ Object
- #size ⇒ Object
- #store(file) ⇒ Object
- #url ⇒ Object
Constructor Details
#initialize(uploader, path) ⇒ File
Returns a new instance of File.
63 64 65 |
# File 'lib/carrierwave/s3cn/storage.rb', line 63 def initialize(uploader, path) @uploader, @path = uploader, path end |
Instance Method Details
#content_type ⇒ Object
83 84 85 |
# File 'lib/carrierwave/s3cn/storage.rb', line 83 def content_type file_info[:content_type] || 'application/octet-stream' end |
#delete ⇒ Object
79 80 81 |
# File 'lib/carrierwave/s3cn/storage.rb', line 79 def delete s3cn_connection.delete(@path) end |
#etag ⇒ Object
91 92 93 |
# File 'lib/carrierwave/s3cn/storage.rb', line 91 def etag file_info[:etag] end |
#meta ⇒ Object
95 96 97 |
# File 'lib/carrierwave/s3cn/storage.rb', line 95 def file_info[:meta] end |
#path ⇒ Object
67 68 69 |
# File 'lib/carrierwave/s3cn/storage.rb', line 67 def path @path end |
#size ⇒ Object
87 88 89 |
# File 'lib/carrierwave/s3cn/storage.rb', line 87 def size file_info[:content_length] || 0 end |
#store(file) ⇒ Object
75 76 77 |
# File 'lib/carrierwave/s3cn/storage.rb', line 75 def store(file) s3cn_connection.store(file, @path) end |
#url ⇒ Object
71 72 73 |
# File 'lib/carrierwave/s3cn/storage.rb', line 71 def url s3cn_connection.download_url(@path) end |