Method: DocuSign_Maestro::ApiClient#object_to_http_body

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

#object_to_http_body(model) ⇒ String

Convert object (array, hash, object, etc) to JSON string.

Parameters:

  • model (Object)

    object to be converted into JSON string

Returns:

  • (String)

    JSON string representation of the object

[View source]

349
350
351
352
353
354
355
356
357
358
# File 'lib/docusign_maestro/client/api_client.rb', line 349

def object_to_http_body(model)
  return model if model.nil? || model.is_a?(String)
  local_body = nil
  if model.is_a?(Array)
    local_body = model.map{|m| object_to_hash(m) }
  else
    local_body = object_to_hash(model)
  end
  local_body.to_json
end