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:
parent
9846498ef0
commit
9548c0385b
2 changed files with 4 additions and 2 deletions
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue