Sha256: a4533b453e19dc83d91cd849995db40ad3a4a22595b1f51981b11145760b4fdb
Contents?: true
Size: 902 Bytes
Versions: 5
Compression:
Stored size: 902 Bytes
Contents
require 'attached/storage/aws' require 'attached/storage/google' require 'attached/storage/rackspace' module Attached module Storage # Create a storage object given a medium and credentials. # # Usage: # # Attached::Storage.storage(:aws, "#{Rails.root}/config/aws.yml" ) # Attached::Storage.storage(:google, "#{Rails.root}/config/google.yml" ) # Attached::Storage.storage(:rackspace, "#{Rails.root}/config/rackspace.yml") def self.storage(medium, credentials) case medium when :aws then return Attached::Storage::AWS.new credentials when :google then return Attached::Storage::Google.new credentials when :rackspace then return Attached::Storage::Rackspace.new credentials else raise "undefined storage medium '#{medium}'" end end end end
Version data entries
5 entries across 5 versions & 1 rubygems