Module: Fog::Image
- Defined in:
- lib/fog/image.rb
Class Method Summary collapse
Class Method Details
.[](provider) ⇒ Object
3 4 5 |
# File 'lib/fog/image.rb', line 3 def self.[](provider) new(:provider => provider) end |
.new(attributes) ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/fog/image.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 if providers.include?(provider) require "fog/#{provider}/image" return Fog::Image.const_get(Fog.providers[provider]).new(attributes) end raise ArgumentError, "#{provider} has no image service" end |