lib/carrierwave/uploader/configuration.rb
def storage(storage = nil)
          case storage
          when Symbol
            if storage_engine = storage_engines[storage]
              self._storage = eval storage_engine
            else
              raise CarrierWave::UnknownStorageError, "Unknown storage: #{storage}"
            end
          when nil
            storage
          else
            self._storage = storage
          end
          _storage
        end
##
# Sets the storage engine to be used when storing files with this uploader.
# Can be any class that implements a #store!(CarrierWave::SanitizedFile) and a #retrieve!
# method. See lib/carrierwave/storage/file.rb for an example. Storage engines should
# be added to CarrierWave::Uploader::Base.storage_engines so they can be referred
# to by a symbol, which should be more convenient
#
# If no argument is given, it will simply return the currently used storage engine.
#
# === Parameters
#
# [storage (Symbol, Class)] The storage engine to use for this uploader
#
# === Returns
#
# [Class] the storage engine to be used with this uploader
#
# === Examples
#
#     storage :file
#     storage CarrierWave::Storage::File
#     storage MyCustomStorageEngine
#
Sets the storage engine to be used when storing files with this uploader.
Can be any class that implements a #store!(CarrierWave::SanitizedFile) and a #retrieve.
method. See lib/carrierwave/storage/file.rb for an example. Storage engines should
be added to CarrierWave::Uploader::Base.storage_engines so they can be referred
to by a symbol, which should be more convenient

If no argument is given, it will simply return the currently used storage engine.

Parameters

[storage (Symbol, Class)] The storage engine to use for this uploader

Returns

[Class] the storage engine to be used with this uploader

Examples


Sets the storage engine to be used when storing files with this uploader . Can be any class that implements a #store! ( CarrierWave :: SanitizedFile ) and a #retrieve . method . See lib / carrierwave / storage / file . rb for an example . Storage engines should be added to CarrierWave :: Uploader :: Base . storage_engines so they can be referred to by a symbol which should be more convenient If no argument is given it will simply return the currently used storage engine . Parameters [ storage ( Symbol Class ) ] The storage engine to use for this uploader Returns [ Class ] the storage engine to be used with this uploader Examples
def storage(storage = nil)
          case storage
          when Symbol
            if storage_engine = storage_engines[storage]
              self._storage = eval storage_engine
            else
              raise CarrierWave::UnknownStorageError, "Unknown storage: #{storage}"
            end
          when nil
            storage
          else
            self._storage = storage
          end
          _storage
        end
def storage ( storage = nil ) case storage when Symbol if storage_engine = storage_engines [ storage ] self . _storage = eval storage_engine else raise CarrierWave :: UnknownStorageError , "Unknown storage: #{storage}" end when nil storage else self . _storage = storage end _storage end
Sets the storage engine to be used when storing files with this uploader.
Sets the storage engine to be used when storing files with this uploader .
storage