Class: DocFox::EvidenceSubmission::UpdateService
- Inherits:
-
BaseService
- Object
- BaseService
- DocFox::EvidenceSubmission::UpdateService
- Defined in:
- lib/doc_fox/evidence_submission/update_service.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
-
#call ⇒ Object
Update an evidence submission.
-
#initialize(id:, data:) ⇒ UpdateService
constructor
A new instance of UpdateService.
Constructor Details
#initialize(id:, data:) ⇒ UpdateService
Returns a new instance of UpdateService.
12 13 14 15 |
# File 'lib/doc_fox/evidence_submission/update_service.rb', line 12 def initialize(id:, data:) @id = id @data = data end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
4 5 6 |
# File 'lib/doc_fox/evidence_submission/update_service.rb', line 4 def data @data end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/doc_fox/evidence_submission/update_service.rb', line 4 def id @id end |
Instance Method Details
#call ⇒ Object
Update an evidence submission.
Examples
service = DocFox::EvidenceSubmission::UpdateService.call(
id: '',
data: {
type: 'evidence_submission',
id: '',
attributes: {
results: {
dob: '1984-01-01',
gender: 'M',
surname: 'Cartman',
forename1: 'Eric',
forename2: nil,
id_number: '8401017223183',
addresses: {
address: [
{
addr_type: 'R',
addr_line1: '28201 E. Bonanza St.',
addr_line2: '',
addr_line3: '',
addr_line4: 'South Park',
addr_postal_code: '8000',
addr_update_date: '2017-11-21'
}
]
},
telephones: {
telephone: [
{
tel_num: '27715555555',
tel_type: 'Cell',
tel_update_date: '2017-09-05'
}
]
},
deceased_date: nil,
deceased_flag: 'N',
verified_date: '2015-06-23',
verified_flag: 'Y',
deceased_reason: nil
}
}
}
)
service.success? # => true
service.errors # => #<ActiveModel::Errors []>
service.response # => #<Faraday::Response ...>
service.response.status # => 200
service.response.body # => {}
service.facade # => #<DocFox::EvidenceSubmission::Facade ...>
service.facade.id
service.id
PATCH /api/v2/evidence_submissions/:id
80 81 82 |
# File 'lib/doc_fox/evidence_submission/update_service.rb', line 80 def call connection.patch("evidence_submissions/#{id}", **params) end |