Class: SdrClient::Deposit::ModelProcess
- Inherits:
-
Object
- Object
- SdrClient::Deposit::ModelProcess
- Defined in:
- lib/sdr_client/deposit/model_process.rb
Overview
The process for doing a deposit from a Cocina Model
Instance Method Summary collapse
-
#initialize(request_dro:, connection:, files: [], accession:, logger: Logger.new(STDOUT)) ⇒ ModelProcess
constructor
A new instance of ModelProcess.
- #run ⇒ Object
Constructor Details
#initialize(request_dro:, connection:, files: [], accession:, logger: Logger.new(STDOUT)) ⇒ ModelProcess
Returns a new instance of ModelProcess.
14 15 16 17 18 19 20 21 |
# File 'lib/sdr_client/deposit/model_process.rb', line 14 def initialize(request_dro:, connection:, files: [], accession:, logger: Logger.new(STDOUT)) @files = files @connection = connection @request_dro = request_dro @logger = logger @accession = accession end |
Instance Method Details
#run ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/sdr_client/deposit/model_process.rb', line 23 def run check_files_exist child_files_match = UploadFilesMetadataBuilder.build(files: files, mime_types: mime_types) upload_responses = UploadFiles.upload(file_metadata: , logger: logger, connection: connection) new_request_dro = UpdateDroWithFileIdentifiers.update(request_dro: request_dro, upload_responses: upload_responses) CreateResource.run(accession: @accession, metadata: new_request_dro, logger: logger, connection: connection) end |