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

each_with_index makes it more concise

This commit is contained in:
Rodrigo Estebanez 2013-10-02 11:44:27 +02:00
parent 4576b38d66
commit 4bf665b27c

View file

@ -74,11 +74,9 @@ module Fog
end
if tags = options.delete('Tags')
i=0
tags.each do |key, value|
i += 1
options["Tags.member.#{i}.Key"] = key.to_s # turns symbol into string
options["Tags.member.#{i}.Value"] = value
tags.each_with_index do |(key, value), i|
options["Tags.member.#{i+1}.Key"] = key.to_s # turns symbol into string
options["Tags.member.#{i+1}.Value"] = value
end
end
if termination_policies = options.delete('TerminationPolicies')