mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[aws] generalize indexed_params to work in more cases
This commit is contained in:
parent
e19bea576c
commit
b1ba9f677a
1 changed files with 5 additions and 2 deletions
|
@ -6,10 +6,13 @@ require 'fog/aws/simpledb'
|
|||
module Fog
|
||||
module AWS
|
||||
|
||||
def self.indexed_param(key, values)
|
||||
def self.indexed_param(key, values, offset = 0)
|
||||
params = {}
|
||||
unless key.include?('%d')
|
||||
key << '.%d'
|
||||
end
|
||||
[*values].each_with_index do |value, index|
|
||||
params["#{key}.#{index}"] = value
|
||||
params[format(key, index + offset)] = value
|
||||
end
|
||||
params
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue