Skip to content

Instantly share code, notes, and snippets.

@bradgignac
bradgignac / compute.rb
Created July 27, 2012 01:41
Fog API Versioning
provider = attributes.delete(:provider).to_s.downcase.to_sym
version = attributes.delete(:version).to_s.downcase.to_sym
case provider
when :rackspace
if version == :v2
require 'fog/rackspace/compute/v2'
Fog::Compute::Rackspace::V2.new(attributes)
else
require 'fog/rackspace/compute'