Module: Fog::Storage
- Defined in:
- lib/fog-external.rb,
lib/fog/external/storage.rb,
lib/fog/external/models/storage/file.rb,
lib/fog/external/models/storage/files.rb,
lib/fog/external/models/storage/directory.rb,
lib/fog/external/models/storage/directories.rb
Defined Under Namespace
Classes: External
Class Method Summary collapse
-
.new(attributes) ⇒ Object
monkey patch to add :external.
Class Method Details
.new(attributes) ⇒ Object
monkey patch to add :external
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/fog-external.rb', line 3 def self.new(attributes) # monkey patch to add :external attributes = attributes.dup # prevent delete from having side effects case provider = attributes.delete(:provider).to_s.downcase.to_sym when :aws require 'fog/aws/storage' Fog::Storage::AWS.new(attributes) when :google require 'fog/google/storage' Fog::Storage::Google.new(attributes) when :local require 'fog/local/storage' Fog::Storage::Local.new(attributes) when :ninefold require 'fog/ninefold/storage' Fog::Storage::Ninefold.new(attributes) when :rackspace require 'fog/rackspace/storage' Fog::Storage::Rackspace.new(attributes) when :external require 'fog/external/storage' Fog::Storage::External.new(attributes) else raise ArgumentError.new("#{provider} is not a recognized storage provider") end end |