1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

prevent side effects when initializing (thanks mitchellh)

This commit is contained in:
geemus 2010-12-13 17:51:16 -08:00
parent 9846498ef0
commit 9548c0385b
2 changed files with 4 additions and 2 deletions

View file

@ -2,7 +2,8 @@ module Fog
class Compute
def self.new(attributes)
case provider = attributes.dup.delete(:provider)
attributes = attributes.dup # prevent delete from having side effects
case provider = attributes.delete(:provider)
when 'AWS'
require 'fog/aws'
Fog::AWS::Compute.new(attributes)

View file

@ -2,7 +2,8 @@ module Fog
class Storage
def self.new(attributes)
case provider = attributes.dup.delete(:provider)
attributes = attributes.dup # prevent delete from having side effects
case provider = attributes.delete(:provider)
when 'AWS'
require 'fog/aws'
Fog::AWS::Storage.new(attributes)