Method: DocuSign_Maestro::ApiClient#build_collection_param

Defined in:
lib/docusign_maestro/client/api_client.rb

#build_collection_param(param, collection_format) ⇒ Object

Build parameter value according to the given collection format.

Parameters:

  • collection_format (String)

    one of :csv, :ssv, :tsv, :pipes and :multi

[View source]

373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
# File 'lib/docusign_maestro/client/api_client.rb', line 373

def build_collection_param(param, collection_format)
  case collection_format
  when :csv
    param.join(',')
  when :ssv
    param.join(' ')
  when :tsv
    param.join("\t")
  when :pipes
    param.join('|')
  when :multi
    # return the array directly as typhoeus will handle it as expected
    param
  else
    fail "unknown collection format: #{collection_format.inspect}"
  end
end