Class: Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/RedcapAPI.rb

Instance Method Summary collapse

Instance Method Details

#to_http_post_arrayObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/RedcapAPI.rb', line 5

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