Method: Orchestrate::Client#delete

Defined in:
lib/orchestrate/client.rb

#delete(collection, key, ref = nil) ⇒ Object

Note:

previous versions of the values at this key are still available via #list_refs and #get.

Sets the current value of a key to a null object.

Parameters:

  • collection (#to_s)

    The name of the collection.

  • key (#to_s)

    The name of the key.

  • ref (#to_s) (defaults to: nil)

    If specified, deletes the ref only if the current value's ref matches.

Returns:

  • Orchestrate::API::Response

Raises:

  • Orchestrate::API::VersionMismatch if the provided ref is not the ref for the current value.

[View source]

217
218
219
220
221
# File 'lib/orchestrate/client.rb', line 217

def delete(collection, key, ref=nil)
  headers = {}
  headers['If-Match'] = API::Helpers.format_ref(ref) if ref
  send_request :delete, [collection, key], { headers: headers }
end