Class: SdrClient::Deposit::UploadFiles

Inherits:
Object
  • Object
show all
Defined in:
lib/sdr_client/deposit/upload_files.rb

Overview

The file uploading part of a deposit

Constant Summary collapse

BLOB_PATH =
'/v1/direct_uploads'

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file_metadata:, logger:, connection:) ⇒ UploadFiles

Returns a new instance of UploadFiles.

Parameters:



20
21
22
23
24
# File 'lib/sdr_client/deposit/upload_files.rb', line 20

def initialize(file_metadata:, logger:, connection:)
  @file_metadata = 
  @logger = logger
  @connection = connection
end

Class Method Details

.upload(file_metadata:, logger:, connection:) ⇒ Object

Parameters:



13
14
15
# File 'lib/sdr_client/deposit/upload_files.rb', line 13

def self.upload(file_metadata:, logger:, connection:)
  new(file_metadata: , logger: logger, connection: connection).run
end

Instance Method Details

#runArray<SdrClient::Deposit::Files::DirectUploadResponse>

Returns the responses from the server for the uploads.

Returns:



27
28
29
30
31
# File 'lib/sdr_client/deposit/upload_files.rb', line 27

def run
  upload_responses = 
  upload_files(upload_responses)
  upload_responses.values
end