Module: CarrierWave::Uploader::Proxy
- Defined in:
- lib/carrierwave/uploader/proxy.rb
Instance Method Summary collapse
-
#blank? ⇒ Boolean
Returns.
-
#current_path ⇒ Object
(also: #path)
Returns.
-
#identifier ⇒ Object
Returns a string that uniquely identifies the last stored file.
-
#read ⇒ Object
Read the contents of the file.
-
#size ⇒ Object
Fetches the size of the currently stored/cached file.
Instance Method Details
#blank? ⇒ Boolean
Returns
- Boolean
-
Whether the uploaded file is blank
10 11 12 |
# File 'lib/carrierwave/uploader/proxy.rb', line 10 def blank? file.blank? end |
#current_path ⇒ Object Also known as: path
Returns
- String
-
the path where the file is currently located.
19 20 21 |
# File 'lib/carrierwave/uploader/proxy.rb', line 19 def current_path file.path if file.respond_to?(:path) end |
#identifier ⇒ Object
Returns a string that uniquely identifies the last stored file
Returns
- String
-
uniquely identifies a file
32 33 34 |
# File 'lib/carrierwave/uploader/proxy.rb', line 32 def identifier file.identifier if file.respond_to?(:identifier) end |
#read ⇒ Object
Read the contents of the file
Returns
- String
-
contents of the file
43 44 45 |
# File 'lib/carrierwave/uploader/proxy.rb', line 43 def read file.read if file.respond_to?(:read) end |
#size ⇒ Object
Fetches the size of the currently stored/cached file
Returns
- Integer
-
size of the file
54 55 56 |
# File 'lib/carrierwave/uploader/proxy.rb', line 54 def size file.respond_to?(:size) ? file.size : 0 end |