Module: Fog::Identity
- Defined in:
- lib/fog/identity.rb
Class Method Summary collapse
Class Method Details
.[](provider) ⇒ Object
3 4 5 |
# File 'lib/fog/identity.rb', line 3 def self.[](provider) new(:provider => provider) end |
.new(attributes) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/fog/identity.rb', line 7 def self.new(attributes) attributes = attributes.dup # Prevent delete from having side effects provider = attributes.delete(:provider).to_s.downcase.to_sym unless providers.include?(provider) raise ArgumentError, "#{provider} has no identity service" end require "fog/#{provider}/identity" begin Fog::Identity.const_get(Fog.providers[provider]) rescue Fog.const_get(Fog.providers[provider])::Identity end.new(attributes) end |