Class: UpdateRecord
- Inherits:
-
DataverseOperations
- Object
- DataverseOperations
- UpdateRecord
- Defined in:
- lib/dvla/dataverse/operations/update_records.rb
Instance Method Summary collapse
-
#alter_record(record_name, record_id, record_data) ⇒ Object
update the record.
- #setup_artifacts ⇒ Object
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
#alter_record(record_name, record_id, record_data) ⇒ Object
update the record. You must provide the record name, the record ID, and the record data.
21 22 23 24 25 26 27 |
# File 'lib/dvla/dataverse/operations/update_records.rb', line 21 def alter_record(record_name, record_id, record_data) setup_http_payload(record_data) apply_filter({ record_name: record_name, id: record_id }) send_request end |
#setup_artifacts ⇒ Object
5 6 7 8 9 |
# File 'lib/dvla/dataverse/operations/update_records.rb', line 5 def setup_artifacts setup_http_headers http_request_artifacts.url = get_url_from_config_file http_request_artifacts.method = :patch end |