Class: Hash
- Inherits:
-
Object
- Object
- Hash
- Defined in:
- lib/redcap-survey-api/hash_extension.rb
Instance Method Summary collapse
Instance Method Details
#to_http_post_array ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/redcap-survey-api/hash_extension.rb', line 2 def to_http_post_array r = {} self.each_key do |k| if (false == self[k].is_a?(Array)) raise "!ERROR: Expecting hash value to be an Array." end self[k].each_with_index do |v,i| r["#{k}[#{i}]"] = v end end return r end |