Class: DeleteRecord

Inherits:
DataverseOperations show all
Defined in:
lib/dvla/dataverse/operations/delete_records.rb

Instance Method Summary collapse

Methods inherited from DataverseOperations

#apply_filter, #get_url_from_config_file, #http_request_artifacts, #initialize, #send_request, #setup_http_headers

Constructor Details

This class inherits a constructor from DataverseOperations

Instance Method Details

#remove_record(record_name, record_id) ⇒ Object

remove the record. You must provide the record ID and the record name. The record ID and the record name should be string

Examples:

remove_record('user', '123-123-123')

Parameters:

  • record_name (String)

    the name of the record

  • record_id (String)

    the record ID usually its UUID



19
20
21
22
23
24
25
26
# File 'lib/dvla/dataverse/operations/delete_records.rb', line 19

def remove_record(record_name, record_id)
  apply_filter({
                 record_name: record_name,
                 id: record_id
               })

  send_request
end

#setup_artifactsObject



5
6
7
8
9
# File 'lib/dvla/dataverse/operations/delete_records.rb', line 5

def setup_artifacts
  setup_http_headers
  http_request_artifacts.url = get_url_from_config_file
  http_request_artifacts.method = :DELETE
end