Created
July 27, 2012 01:41
-
-
Save bradgignac/3185711 to your computer and use it in GitHub Desktop.
Fog API Versioning
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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' | |
| Fog::Compute::Rackspace.new(attributes) | |
| end | |
| end | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| connection = Fog::Compute.new({ | |
| :provider => 'Rackspace', | |
| :version => :v2 | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment