214: def pathhashlist(key, arr_of_hashes, mappings)
215: raise ArgumentError, "expected a key that is a String" unless key.is_a? String
216: raise ArgumentError, "expected a arr_of_hashes that is an Array" unless arr_of_hashes.is_a? Array
217: arr_of_hashes.each{|h| raise ArgumentError, "expected each element of arr_of_hashes to be a Hash" unless h.is_a?(Hash)}
218: raise ArgumentError, "expected a mappings that is an Hash" unless mappings.is_a? Hash
219: params = {}
220: arr_of_hashes.each_with_index do |hash, i|
221: hash.each do |attribute, value|
222: params["#{key}.#{i+1}.#{mappings[attribute]}"] = value.to_s
223: end
224: end
225: params
226: end