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

[core] fix attribute squashing with : in key

It can happen, that the squashing options conatins a : within its key,
for example: :squash => :'ovf:Item' . However this fails if we don't
quote the used symbol.

Note that :a == :'a', hence we don't change anything on how things work.
This commit is contained in:
Peter Meier 2011-09-27 11:26:54 +02:00
parent 7a3ac7e54f
commit 7ac96b96e3

View file

@ -71,8 +71,8 @@ module Fog
class_eval <<-EOS, __FILE__, __LINE__
def #{name}=(new_data)
if new_data.is_a?(Hash)
if new_data.has_key?(:#{squash})
attributes[:#{name}] = new_data[:#{squash}]
if new_data.has_key?(:'#{squash}')
attributes[:#{name}] = new_data[:'#{squash}']
elsif new_data.has_key?("#{squash}")
attributes[:#{name}] = new_data["#{squash}"]
else