Method: Orchestrate::Client#purge

Defined in:
lib/orchestrate/client.rb

#purge(collection, key, ref = nil) ⇒ 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, purges the ref only if the current value's ref matches.

Returns:

  • Orchestrate::API::Response


229
230
231
232
233
# File 'lib/orchestrate/client.rb', line 229

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