Module: CarrierWave::Uploader::Proxy
- Included in:
- Base
- Defined in:
- lib/carrierwave/uploader/proxy.rb
Instance Method Summary (collapse)
-
- (Boolean) blank?
Returns.
-
- (Object) current_path
(also: #path)
Returns.
-
- (Object) identifier
Returns a string that uniquely identifies the last stored file.
-
- (Object) read
Read the contents of the file.
-
- (Object) size
Fetches the size of the currently stored/cached file.
Instance Method Details
- (Boolean) blank?
Returns
- Boolean
-
Whether the uploaded file is blank
12 13 14 |
# File 'lib/carrierwave/uploader/proxy.rb', line 12 def blank? file.blank? end |
- (Object) current_path Also known as: path
Returns
- String
-
the path where the file is currently located.
21 22 23 |
# File 'lib/carrierwave/uploader/proxy.rb', line 21 def current_path file.path if file.respond_to?(:path) end |
- (Object) identifier
Returns a string that uniquely identifies the last stored file
Returns
- String
-
uniquely identifies a file
34 35 36 |
# File 'lib/carrierwave/uploader/proxy.rb', line 34 def identifier storage.identifier if storage.respond_to?(:identifier) end |
- (Object) read
Read the contents of the file
Returns
- String
-
contents of the file
45 46 47 |
# File 'lib/carrierwave/uploader/proxy.rb', line 45 def read file.read if file.respond_to?(:read) end |
- (Object) size
Fetches the size of the currently stored/cached file
Returns
- Integer
-
size of the file
56 57 58 |
# File 'lib/carrierwave/uploader/proxy.rb', line 56 def size file.respond_to?(:size) ? file.size : 0 end |