lib/mambanation/request.rb in mambanation-0.1.30 vs lib/mambanation/request.rb in mambanation-0.1.31
- old
+ new
@@ -61,10 +61,13 @@
delete(uri, options[:headers])
end
def to_query(options)
options.inject([]) do |collection, opt|
- collection << "#{opt[0]}=#{opt[1]}"
+ collection << case opt[1].class.to_s
+ when "Array" then opt[1].map { |value| "#{opt[0]}[]=#{value}" }.join('&')
+ else "#{opt[0]}=#{opt[1]}"
+ end
collection
end * '&'
end
end
end
\ No newline at end of file