Module: Ethon::Easy::Queryable
- Defined in:
- lib/canvas/canvas_api.rb
Instance Method Summary collapse
Instance Method Details
#recursively_generate_pairs(h, prefix, pairs) ⇒ Object
329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 |
# File 'lib/canvas/canvas_api.rb', line 329 def recursively_generate_pairs(h, prefix, pairs) case h when Hash h.each_pair do |k, v| key = prefix.nil? ? k : "#{prefix}[#{k}]" pairs_for(v, key, pairs) end when Canvas::PairArray h.each do |k, v| key = prefix.nil? ? k : "#{prefix}[#{k}]" pairs_for(v, key, pairs) end when Array h.each_with_index do |v, i| key = "#{prefix}[#{i}]" pairs_for(v, key, pairs) end end end |