Class: SdrClient::Deposit::Process
- Inherits:
-
Object
- Object
- SdrClient::Deposit::Process
- Defined in:
- lib/sdr_client/deposit/process.rb
Overview
The process for doing a deposit
Instance Method Summary collapse
-
#initialize(metadata:, grouping_strategy: SingleFileGroupingStrategy, connection:, files: [], accession:, logger: Logger.new(STDOUT)) ⇒ Process
constructor
rubocop:disable Metrics/ParameterLists.
-
#run ⇒ String
rubocop:disable Metrics/AbcSize.
Constructor Details
#initialize(metadata:, grouping_strategy: SingleFileGroupingStrategy, connection:, files: [], accession:, logger: Logger.new(STDOUT)) ⇒ Process
rubocop:disable Metrics/ParameterLists
17 18 19 20 21 22 23 24 25 |
# File 'lib/sdr_client/deposit/process.rb', line 17 def initialize(metadata:, grouping_strategy: SingleFileGroupingStrategy, connection:, files: [], accession:, logger: Logger.new(STDOUT)) @files = files @connection = connection @metadata = @logger = logger @grouping_strategy = grouping_strategy @accession = accession end |
Instance Method Details
#run ⇒ String
rubocop:disable Metrics/AbcSize
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/sdr_client/deposit/process.rb', line 30 def run check_files_exist = UploadFilesMetadataBuilder.build(files: files, mime_types: mime_types) upload_responses = UploadFiles.upload(file_metadata: , logger: logger, connection: connection) = MetadataBuilder.new(metadata: , grouping_strategy: grouping_strategy, logger: logger) request = .with_uploads(upload_responses) model = Cocina::Models.build_request(request.as_json.with_indifferent_access) CreateResource.run(accession: @accession, metadata: model, logger: logger, connection: connection) end |